2019-05-09 04:38:36 +08:00
|
|
|
apiVersion: kubelet.config.k8s.io/v1beta1
|
|
|
|
kind: KubeletConfiguration
|
|
|
|
nodeStatusUpdateFrequency: "{{ kubelet_status_update_frequency }}"
|
2023-05-12 01:53:04 +08:00
|
|
|
failSwapOn: {{ kubelet_fail_swap_on }}
|
2019-05-09 04:38:36 +08:00
|
|
|
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 != "\"\"" %}
|
2023-01-24 08:20:17 +08:00
|
|
|
{% set kubelet_enforce_node_allocatable_list = kubelet_enforce_node_allocatable.split(",") %}
|
2019-05-09 04:38:36 +08:00
|
|
|
enforceNodeAllocatable:
|
|
|
|
{% for item in kubelet_enforce_node_allocatable_list %}
|
|
|
|
- {{ item }}
|
|
|
|
{% endfor %}
|
|
|
|
{% endif %}
|
|
|
|
staticPodPath: {{ kube_manifest_dir }}
|
2022-06-06 22:34:26 +08:00
|
|
|
cgroupDriver: {{ kubelet_cgroup_driver | default('systemd') }}
|
2020-11-26 16:32:19 +08:00
|
|
|
containerLogMaxFiles: {{ kubelet_logfiles_max_nr }}
|
|
|
|
containerLogMaxSize: {{ kubelet_logfiles_max_size }}
|
2019-05-09 04:38:36 +08:00
|
|
|
maxPods: {{ kubelet_max_pods }}
|
2022-07-05 15:20:48 +08:00
|
|
|
podPidsLimit: {{ kubelet_pod_pids_limit }}
|
2019-05-09 04:38:36 +08:00
|
|
|
address: {{ kubelet_bind_address }}
|
|
|
|
readOnlyPort: {{ kube_read_only_port }}
|
2019-12-04 03:56:58 +08:00
|
|
|
healthzPort: {{ kubelet_healthz_port }}
|
|
|
|
healthzBindAddress: {{ kubelet_healthz_bind_address }}
|
2019-05-09 04:38:36 +08:00
|
|
|
kubeletCgroups: {{ kubelet_kubelet_cgroups }}
|
|
|
|
clusterDomain: {{ dns_domain }}
|
2023-07-05 11:36:54 +08:00
|
|
|
{% if kubelet_protect_kernel_defaults | bool %}
|
2020-09-03 22:41:41 +08:00
|
|
|
protectKernelDefaults: true
|
|
|
|
{% endif %}
|
2023-07-05 11:36:54 +08:00
|
|
|
{% if kubelet_rotate_certificates | bool %}
|
2019-10-16 19:31:41 +08:00
|
|
|
rotateCertificates: true
|
|
|
|
{% endif %}
|
2023-07-05 11:36:54 +08:00
|
|
|
{% if kubelet_rotate_server_certificates | bool %}
|
2020-09-03 22:25:41 +08:00
|
|
|
serverTLSBootstrap: true
|
|
|
|
{% endif %}
|
2019-05-09 04:38:36 +08: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 #}
|
2023-07-05 11:36:54 +08:00
|
|
|
{% if kube_reserved | bool %}
|
2022-12-31 00:05:30 +08:00
|
|
|
kubeReservedCgroup: {{ kube_reserved_cgroups }}
|
2019-05-09 04:38:36 +08:00
|
|
|
kubeReserved:
|
2023-07-05 11:36:54 +08:00
|
|
|
{% if is_kube_master | bool %}
|
2024-04-25 15:32:06 +08:00
|
|
|
cpu: "{{ kube_master_cpu_reserved }}"
|
2020-09-23 06:20:09 +08:00
|
|
|
memory: {{ kube_master_memory_reserved }}
|
2022-06-06 22:34:26 +08:00
|
|
|
{% if kube_master_ephemeral_storage_reserved is defined %}
|
|
|
|
ephemeral-storage: {{ kube_master_ephemeral_storage_reserved }}
|
|
|
|
{% endif %}
|
2022-07-05 15:20:48 +08:00
|
|
|
{% if kube_master_pid_reserved is defined %}
|
2022-07-31 11:14:27 +08:00
|
|
|
pid: "{{ kube_master_pid_reserved }}"
|
2022-07-05 15:20:48 +08:00
|
|
|
{% endif %}
|
2019-05-09 04:38:36 +08:00
|
|
|
{% else %}
|
2024-04-25 15:32:06 +08:00
|
|
|
cpu: "{{ kube_cpu_reserved }}"
|
2020-09-23 06:20:09 +08:00
|
|
|
memory: {{ kube_memory_reserved }}
|
2022-06-06 22:34:26 +08:00
|
|
|
{% if kube_ephemeral_storage_reserved is defined %}
|
|
|
|
ephemeral-storage: {{ kube_ephemeral_storage_reserved }}
|
|
|
|
{% endif %}
|
2022-07-05 15:20:48 +08:00
|
|
|
{% if kube_pid_reserved is defined %}
|
2022-07-31 11:14:27 +08:00
|
|
|
pid: "{{ kube_pid_reserved }}"
|
2022-07-05 15:20:48 +08:00
|
|
|
{% endif %}
|
2019-05-09 04:38:36 +08:00
|
|
|
{% endif %}
|
2022-12-31 00:05:30 +08:00
|
|
|
{% endif %}
|
2023-07-05 11:36:54 +08:00
|
|
|
{% if system_reserved | bool %}
|
2022-12-31 00:05:30 +08:00
|
|
|
systemReservedCgroup: {{ system_reserved_cgroups }}
|
2019-08-01 02:24:15 +08:00
|
|
|
systemReserved:
|
2023-07-05 11:36:54 +08:00
|
|
|
{% if is_kube_master | bool %}
|
2024-04-25 15:32:06 +08:00
|
|
|
cpu: "{{ system_master_cpu_reserved }}"
|
2020-09-23 06:20:09 +08:00
|
|
|
memory: {{ system_master_memory_reserved }}
|
2022-06-06 22:34:26 +08:00
|
|
|
{% if system_master_ephemeral_storage_reserved is defined %}
|
|
|
|
ephemeral-storage: {{ system_master_ephemeral_storage_reserved }}
|
|
|
|
{% endif %}
|
2022-07-05 15:20:48 +08:00
|
|
|
{% if system_master_pid_reserved is defined %}
|
2022-07-31 11:14:27 +08:00
|
|
|
pid: "{{ system_master_pid_reserved }}"
|
2022-07-05 15:20:48 +08:00
|
|
|
{% endif %}
|
2019-08-01 02:24:15 +08:00
|
|
|
{% else %}
|
2024-04-25 15:32:06 +08:00
|
|
|
cpu: "{{ system_cpu_reserved }}"
|
2020-09-23 06:20:09 +08:00
|
|
|
memory: {{ system_memory_reserved }}
|
2022-06-06 22:34:26 +08:00
|
|
|
{% if system_ephemeral_storage_reserved is defined %}
|
|
|
|
ephemeral-storage: {{ system_ephemeral_storage_reserved }}
|
|
|
|
{% endif %}
|
2022-07-05 15:20:48 +08:00
|
|
|
{% if system_pid_reserved is defined %}
|
2022-07-31 11:14:27 +08:00
|
|
|
pid: "{{ system_pid_reserved }}"
|
2022-07-05 15:20:48 +08:00
|
|
|
{% endif %}
|
2019-08-01 02:24:15 +08:00
|
|
|
{% endif %}
|
|
|
|
{% endif %}
|
2023-07-05 11:36:54 +08:00
|
|
|
{% if is_kube_master | bool and eviction_hard_control_plane is defined and eviction_hard_control_plane %}
|
2022-01-24 16:13:57 +08:00
|
|
|
evictionHard:
|
2022-08-23 16:55:24 +08:00
|
|
|
{{ eviction_hard_control_plane | to_nice_yaml(indent=2) | indent(2) }}
|
2023-07-05 11:36:54 +08:00
|
|
|
{% elif not is_kube_master | bool and eviction_hard is defined and eviction_hard %}
|
2022-01-24 16:13:57 +08:00
|
|
|
evictionHard:
|
2022-08-23 16:55:24 +08:00
|
|
|
{{ eviction_hard | to_nice_yaml(indent=2) | indent(2) }}
|
2022-01-24 16:13:57 +08:00
|
|
|
{% endif %}
|
2019-08-01 02:24:15 +08:00
|
|
|
resolvConf: "{{ kube_resolv_conf }}"
|
2020-02-15 08:05:28 +08:00
|
|
|
{% if kubelet_config_extra_args %}
|
|
|
|
{{ kubelet_config_extra_args | to_nice_yaml(indent=2) }}
|
|
|
|
{% endif %}
|
2021-04-29 20:20:50 +08:00
|
|
|
{% if inventory_hostname in groups['kube_node'] and kubelet_node_config_extra_args %}
|
2020-02-15 08:05:28 +08:00
|
|
|
{{ kubelet_node_config_extra_args | to_nice_yaml(indent=2) }}
|
|
|
|
{% endif %}
|
2022-07-19 15:50:07 +08:00
|
|
|
{% if kubelet_feature_gates or kube_feature_gates %}
|
2021-10-05 21:07:10 +08:00
|
|
|
featureGates:
|
2022-07-19 15:50:07 +08:00
|
|
|
{% for feature in (kubelet_feature_gates | default(kube_feature_gates, true)) %}
|
2023-07-05 11:36:54 +08:00
|
|
|
{{ feature | replace("=", ": ") }}
|
2021-10-05 21:07:10 +08:00
|
|
|
{% endfor %}
|
|
|
|
{% endif %}
|
2020-08-13 17:48:13 +08: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 16:42:15 +08:00
|
|
|
eventRecordQPS: {{ kubelet_event_record_qps }}
|
2021-06-28 14:53:25 +08:00
|
|
|
shutdownGracePeriod: {{ kubelet_shutdown_grace_period }}
|
|
|
|
shutdownGracePeriodCriticalPods: {{ kubelet_shutdown_grace_period_critical_pods }}
|
2023-05-12 01:53:04 +08:00
|
|
|
{% if not kubelet_fail_swap_on %}
|
2021-11-30 16:52:56 +08:00
|
|
|
memorySwap:
|
2023-05-12 01:53:04 +08:00
|
|
|
swapBehavior: {{ kubelet_swap_behavior }}
|
2021-11-30 16:52:56 +08:00
|
|
|
{% endif %}
|
2022-05-10 00:25:19 +08:00
|
|
|
{% if kubelet_streaming_connection_idle_timeout is defined %}
|
|
|
|
streamingConnectionIdleTimeout: {{ kubelet_streaming_connection_idle_timeout }}
|
|
|
|
{% endif %}
|
2023-02-27 16:26:19 +08:00
|
|
|
{% if kubelet_image_gc_high_threshold is defined %}
|
|
|
|
imageGCHighThresholdPercent: {{ kubelet_image_gc_high_threshold }}
|
|
|
|
{% endif %}
|
|
|
|
{% if kubelet_image_gc_low_threshold is defined %}
|
|
|
|
imageGCLowThresholdPercent: {{ kubelet_image_gc_low_threshold }}
|
|
|
|
{% endif %}
|
2022-05-10 00:25:19 +08:00
|
|
|
{% if kubelet_make_iptables_util_chains is defined %}
|
|
|
|
makeIPTablesUtilChains: {{ kubelet_make_iptables_util_chains | bool }}
|
|
|
|
{% endif %}
|
2022-07-19 15:50:07 +08:00
|
|
|
{% if kubelet_seccomp_default is defined %}
|
|
|
|
seccompDefault: {{ kubelet_seccomp_default | bool }}
|
|
|
|
{% endif %}
|
2023-07-26 04:12:20 +08:00
|
|
|
{% if kubelet_cpu_manager_policy is defined %}
|
|
|
|
cpuManagerPolicy: {{ kubelet_cpu_manager_policy }}
|
2023-08-18 16:26:28 +08:00
|
|
|
{% endif %}
|
2024-03-23 03:21:39 +08:00
|
|
|
{% if kubelet_cpu_manager_policy_options is defined %}
|
|
|
|
cpuManagerPolicyOptions:
|
|
|
|
{{ kubelet_cpu_manager_policy_options | to_nice_yaml(indent=2) }}
|
|
|
|
{% endif %}
|
2023-09-04 14:39:48 +08:00
|
|
|
{% if kubelet_topology_manager_policy is defined %}
|
|
|
|
topologyManagerPolicy: {{ kubelet_topology_manager_policy }}
|
2023-08-18 16:26:28 +08:00
|
|
|
{% endif %}
|
|
|
|
{% if kubelet_topology_manager_scope is defined %}
|
|
|
|
topologyManagerScope: {{ kubelet_topology_manager_scope }}
|
2023-09-04 14:39:48 +08:00
|
|
|
{% endif %}
|
2024-01-25 17:24:35 +08:00
|
|
|
{% if kubelet_tracing %}
|
|
|
|
tracing:
|
|
|
|
endpoint: {{ kubelet_tracing_endpoint }}
|
|
|
|
samplingRatePerMillion: {{ kubelet_tracing_sampling_rate_per_million }}
|
|
|
|
{% endif %}
|