2019-05-08 20:38:36 +00:00
|
|
|
apiVersion: kubelet.config.k8s.io/v1beta1
|
|
|
|
kind: KubeletConfiguration
|
|
|
|
nodeStatusUpdateFrequency: "{{ kubelet_status_update_frequency }}"
|
|
|
|
failSwapOn: {{ kubelet_fail_swap_on|default(true) }}
|
|
|
|
authentication:
|
|
|
|
anonymous:
|
|
|
|
enabled: false
|
|
|
|
webhook:
|
|
|
|
enabled: {{ kubelet_authentication_token_webhook }}
|
|
|
|
x509:
|
|
|
|
clientCAFile: {{ kube_cert_dir }}/ca.crt
|
|
|
|
authorization:
|
|
|
|
{% if kubelet_authorization_mode_webhook %}
|
|
|
|
mode: Webhook
|
|
|
|
{% else %}
|
|
|
|
mode: AlwaysAllow
|
|
|
|
{% endif %}
|
|
|
|
{% if kubelet_enforce_node_allocatable is defined and kubelet_enforce_node_allocatable != "\"\"" %}
|
|
|
|
{% set kubelet_enforce_node_allocatable_list = kubelet_enforce_node_allocatable.split() %}
|
|
|
|
enforceNodeAllocatable:
|
|
|
|
{% for item in kubelet_enforce_node_allocatable_list %}
|
|
|
|
- {{ item }}
|
|
|
|
{% endfor %}
|
|
|
|
{% endif %}
|
|
|
|
staticPodPath: {{ kube_manifest_dir }}
|
2021-11-05 14:59:54 +00:00
|
|
|
cgroupDriver: {{ kubelet_cgroup_driver }}
|
2020-11-26 08:32:19 +00:00
|
|
|
containerLogMaxFiles: {{ kubelet_logfiles_max_nr }}
|
|
|
|
containerLogMaxSize: {{ kubelet_logfiles_max_size }}
|
2019-05-08 20:38:36 +00:00
|
|
|
maxPods: {{ kubelet_max_pods }}
|
|
|
|
address: {{ kubelet_bind_address }}
|
|
|
|
readOnlyPort: {{ kube_read_only_port }}
|
2019-12-03 19:56:58 +00:00
|
|
|
healthzPort: {{ kubelet_healthz_port }}
|
|
|
|
healthzBindAddress: {{ kubelet_healthz_bind_address }}
|
2019-05-08 20:38:36 +00:00
|
|
|
kubeletCgroups: {{ kubelet_kubelet_cgroups }}
|
|
|
|
clusterDomain: {{ dns_domain }}
|
2020-09-03 14:41:41 +00:00
|
|
|
{% if kubelet_protect_kernel_defaults|bool %}
|
|
|
|
protectKernelDefaults: true
|
|
|
|
{% endif %}
|
2019-10-16 11:31:41 +00:00
|
|
|
{% if kubelet_rotate_certificates|bool %}
|
|
|
|
rotateCertificates: true
|
|
|
|
{% endif %}
|
2020-09-03 14:25:41 +00:00
|
|
|
{% if kubelet_rotate_server_certificates|bool %}
|
|
|
|
serverTLSBootstrap: true
|
|
|
|
{% endif %}
|
2019-05-08 20:38:36 +00:00
|
|
|
{# DNS settings for kubelet #}
|
|
|
|
{% if enable_nodelocaldns %}
|
|
|
|
{% set kubelet_cluster_dns = [nodelocaldns_ip] %}
|
|
|
|
{% elif dns_mode in ['coredns'] %}
|
|
|
|
{% set kubelet_cluster_dns = [skydns_server] %}
|
|
|
|
{% elif dns_mode == 'coredns_dual' %}
|
|
|
|
{% set kubelet_cluster_dns = [skydns_server,skydns_server_secondary] %}
|
|
|
|
{% elif dns_mode == 'manual' %}
|
|
|
|
{% set kubelet_cluster_dns = [manual_dns_server] %}
|
|
|
|
{% else %}
|
|
|
|
{% set kubelet_cluster_dns = [] %}
|
|
|
|
{% endif %}
|
|
|
|
clusterDNS:
|
|
|
|
{% for dns_address in kubelet_cluster_dns %}
|
|
|
|
- {{ dns_address }}
|
|
|
|
{% endfor %}
|
|
|
|
{# Node reserved CPU/memory #}
|
|
|
|
kubeReserved:
|
|
|
|
{% if is_kube_master|bool %}
|
|
|
|
cpu: {{ kube_master_cpu_reserved }}
|
2020-09-22 22:20:09 +00:00
|
|
|
memory: {{ kube_master_memory_reserved }}
|
2019-05-08 20:38:36 +00:00
|
|
|
{% else %}
|
|
|
|
cpu: {{ kube_cpu_reserved }}
|
2020-09-22 22:20:09 +00:00
|
|
|
memory: {{ kube_memory_reserved }}
|
2019-05-08 20:38:36 +00:00
|
|
|
{% endif %}
|
2019-07-31 18:24:15 +00:00
|
|
|
{% if system_reserved is defined and system_reserved %}
|
|
|
|
systemReserved:
|
|
|
|
{% if is_kube_master|bool %}
|
2020-09-22 22:20:09 +00:00
|
|
|
cpu: {{ system_master_cpu_reserved }}
|
|
|
|
memory: {{ system_master_memory_reserved }}
|
2019-07-31 18:24:15 +00:00
|
|
|
{% else %}
|
2020-09-22 22:20:09 +00:00
|
|
|
cpu: {{ system_cpu_reserved }}
|
|
|
|
memory: {{ system_memory_reserved }}
|
2019-07-31 18:24:15 +00:00
|
|
|
{% endif %}
|
|
|
|
{% endif %}
|
|
|
|
resolvConf: "{{ kube_resolv_conf }}"
|
2020-02-15 00:05:28 +00:00
|
|
|
{% if kubelet_config_extra_args %}
|
|
|
|
{{ kubelet_config_extra_args | to_nice_yaml(indent=2) }}
|
|
|
|
{% endif %}
|
2021-04-29 12:20:50 +00:00
|
|
|
{% if inventory_hostname in groups['kube_node'] and kubelet_node_config_extra_args %}
|
2020-02-15 00:05:28 +00:00
|
|
|
{{ kubelet_node_config_extra_args | to_nice_yaml(indent=2) }}
|
|
|
|
{% endif %}
|
2021-10-05 13:07:10 +00:00
|
|
|
{% if kube_feature_gates %}
|
|
|
|
featureGates:
|
|
|
|
{% for feature in kube_feature_gates %}
|
|
|
|
{{ feature|replace("=", ": ") }}
|
|
|
|
{% endfor %}
|
|
|
|
{% endif %}
|
2020-08-13 09:48:13 +00:00
|
|
|
{% if tls_min_version is defined %}
|
|
|
|
tlsMinVersion: {{ tls_min_version }}
|
|
|
|
{% endif %}
|
|
|
|
{% if tls_cipher_suites is defined %}
|
|
|
|
tlsCipherSuites:
|
|
|
|
{% for tls in tls_cipher_suites %}
|
|
|
|
- {{ tls }}
|
|
|
|
{% endfor %}
|
|
|
|
{% endif %}
|
2020-11-03 08:42:15 +00:00
|
|
|
{% if kubelet_event_record_qps %}
|
|
|
|
eventRecordQPS: {{ kubelet_event_record_qps }}
|
|
|
|
{% endif %}
|
2021-06-28 06:53:25 +00:00
|
|
|
{% if kube_version is version('v1.21.0', '>=') %}
|
|
|
|
shutdownGracePeriod: {{ kubelet_shutdown_grace_period }}
|
|
|
|
shutdownGracePeriodCriticalPods: {{ kubelet_shutdown_grace_period_critical_pods }}
|
|
|
|
{% endif %}
|
2021-11-30 08:52:56 +00:00
|
|
|
{% if not kubelet_fail_swap_on|default(true) %}
|
|
|
|
memorySwap:
|
|
|
|
swapBehavior: {{ kubelet_swap_behavior|default("LimitedSwap") }}
|
|
|
|
{% endif %}
|