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_kubeconfig_path: "{% if nodename | search('caas_master') %}/etc/kubernetes/kubeconfig/kubeletc.yml{% else %}/root/kubeletc.yml{% endif %}"
18 common_kubelet_params:
19 - "--hostname-override={{ networking.infra_internal.ip }}"
20 - "--kubeconfig={{ kubelet_kubeconfig_path }}"
21 - "--network-plugin=cni"
22 - "--node-labels={{ lookup('template', 'node_labels.j2') | trim }}"
23 - "--pod-infra-container-image={{ container_image_names | select('search', '/kubernetespause') | list | last }}"
24 - "--register-node=true"
26 master_kubelet_params:
27 - "--config=/etc/kubernetes/kubeconfig/master-config.yaml"
29 worker_kubelet_params:
30 - "--bootstrap-kubeconfig=/etc/kubernetes/kubeconfig/kubelet-bootstrapc.yml"
31 - "--config=/etc/kubernetes/kubeconfig/worker-config.yaml"
34 - path: "/home/{{ users.admin_user_name }}/.kube/config"
35 owner: "{{ users.admin_user_name }}"
36 group: "{{ users.admin_user_name }}"
39 total_cpus: "{{ ansible_local['cpu_allocation'].values() | map(attribute='set') | map('length') | sum }}"
40 default_allocation: "{{ caas.cpu_allocation_mapping | get_mapped_key('pool_name', 'default') }}"
41 default_cpu: "{{ ansible_local['cpu_allocation'].get(default_allocation, {}).get('set', []) | length }}"
42 system_reserved_cpu: "{{ total_cpus|int - kube_reserved_cpu|int - default_cpu|int }}"