4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
16 kubelet_healthcheck_port: 10248
18 kubelet_kubeconfig_path: "{% if nodename | search('caas_master') %}/etc/kubernetes/kubeconfig/kubeletc.yml{% else %}/root/kubeletc.yml{% endif %}"
20 common_kubelet_params:
21 - "--hostname-override={{ networking.infra_internal.ip }}"
22 - "--kubeconfig={{ kubelet_kubeconfig_path }}"
23 - "--network-plugin=cni"
24 - "--node-labels={{ lookup('template', 'node_labels.j2') | trim }}"
25 - "--pod-infra-container-image={{ container_image_names | select('search', '/kubernetespause') | list | last }}"
26 - "--register-node=true"
27 - "--enable-debugging-handlers=false"
29 master_kubelet_params:
30 - "--config=/etc/kubernetes/kubeconfig/master-config.yaml"
32 worker_kubelet_params:
33 - "--bootstrap-kubeconfig=/etc/kubernetes/kubeconfig/kubelet-bootstrapc.yml"
34 - "--config=/etc/kubernetes/kubeconfig/worker-config.yaml"
37 - path: "/home/{{ users.admin_user_name }}/.kube/config"
38 owner: "{{ users.admin_user_name }}"
39 group: "{{ users.admin_user_name }}"
42 total_cpus: "{{ ansible_local['cpu_allocation'].values() | map(attribute='set') | map('length') | sum }}"
43 default_allocation: "{{ caas.cpu_allocation_mapping | get_mapped_key('pool_name', 'default') }}"
44 default_cpu: "{{ ansible_local['cpu_allocation'].get(default_allocation, {}).get('set', []) | length }}"
45 system_reserved_cpu: "{{ total_cpus|int - kube_reserved_cpu|int - default_cpu|int }}"