Kubelet healthcheck reimagined.
[ta/caas-kubernetes.git] / ansible / roles / kubelet / defaults / main.yaml
1 ---
2 # Copyright 2019 Nokia
3 #
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
7 #
8 #     http://www.apache.org/licenses/LICENSE-2.0
9 #
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.
15
16 kubelet_healthcheck_port: 10248
17
18 kubelet_kubeconfig_path: "{% if nodename | search('caas_master') %}/etc/kubernetes/kubeconfig/kubeletc.yml{% else %}/root/kubeletc.yml{% endif %}"
19
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
28 master_kubelet_params:
29   - "--config=/etc/kubernetes/kubeconfig/master-config.yaml"
30
31 worker_kubelet_params:
32   - "--bootstrap-kubeconfig=/etc/kubernetes/kubeconfig/kubelet-bootstrapc.yml"
33   - "--config=/etc/kubernetes/kubeconfig/worker-config.yaml"
34
35 kubectl_configs:
36   - path: "/home/{{ users.admin_user_name }}/.kube/config"
37     owner: "{{ users.admin_user_name }}"
38     group: "{{ users.admin_user_name }}"
39
40 kube_reserved_cpu: 0
41 total_cpus: "{{ ansible_local['cpu_allocation'].values() | map(attribute='set') | map('length') | sum }}"
42 default_allocation: "{{ caas.cpu_allocation_mapping | get_mapped_key('pool_name', 'default') }}"
43 default_cpu: "{{ ansible_local['cpu_allocation'].get(default_allocation, {}).get('set', []) | length }}"
44 system_reserved_cpu: "{{ total_cpus|int - kube_reserved_cpu|int - default_cpu|int  }}"