2022-06-07 03:25:57 +08:00
apiVersion: kubeadm.k8s.io/v1beta3
2018-10-04 17:05:55 +08:00
kind: InitConfiguration
2019-08-15 17:26:33 +08:00
{% if kubeadm_token is defined %}
bootstrapTokens:
- token: "{{ kubeadm_token }}"
description: "kubespray kubeadm bootstrap token"
ttl: "24h"
{% endif %}
2019-07-02 16:51:08 +08:00
localAPIEndpoint:
2023-04-11 06:01:17 +08:00
advertiseAddress: {{ kube_apiserver_address }}
2018-10-04 17:05:55 +08:00
bindPort: {{ kube_apiserver_port }}
2019-07-02 16:51:08 +08:00
{% if kubeadm_certificate_key is defined %}
certificateKey: {{ kubeadm_certificate_key }}
{% endif %}
2018-10-04 17:05:55 +08:00
nodeRegistration:
2023-07-05 11:36:54 +08:00
{% if kube_override_hostname | default('') %}
2018-10-04 17:05:55 +08:00
name: {{ kube_override_hostname }}
{% endif %}
2021-04-29 20:20:50 +08:00
{% if inventory_hostname in groups['kube_control_plane'] and inventory_hostname not in groups['kube_node'] %}
2018-10-04 17:05:55 +08:00
taints:
2022-12-20 07:57:43 +08:00
- effect: NoSchedule
key: node-role.kubernetes.io/control-plane
2019-04-19 21:01:54 +08:00
{% else %}
2019-07-02 16:51:08 +08:00
taints: []
{% endif %}
2019-07-11 14:46:54 +08:00
criSocket: {{ cri_socket }}
2020-02-18 20:47:28 +08:00
{% if cloud_provider is defined and cloud_provider in ["external"] %}
kubeletExtraArgs:
cloud-provider: external
{% endif %}
2022-10-06 15:39:52 +08:00
{% if kubeadm_patches is defined and kubeadm_patches.enabled %}
patches:
directory: {{ kubeadm_patches.dest_dir }}
{% endif %}
2018-10-04 17:05:55 +08:00
---
2022-06-07 03:25:57 +08:00
apiVersion: kubeadm.k8s.io/v1beta3
2018-10-04 17:05:55 +08:00
kind: ClusterConfiguration
2018-11-08 04:41:11 +08:00
clusterName: {{ cluster_name }}
2018-10-04 17:05:55 +08:00
etcd:
2022-02-23 00:53:16 +08:00
{% if etcd_deployment_type != "kubeadm" %}
2018-10-04 17:05:55 +08:00
external:
endpoints:
{% for endpoint in etcd_access_addresses.split(',') %}
- {{ endpoint }}
{% endfor %}
2019-04-19 21:01:54 +08:00
caFile: {{ etcd_cert_dir }}/{{ kube_etcd_cacert_file }}
certFile: {{ etcd_cert_dir }}/{{ kube_etcd_cert_file }}
keyFile: {{ etcd_cert_dir }}/{{ kube_etcd_key_file }}
2022-02-23 00:53:16 +08:00
{% elif etcd_deployment_type == "kubeadm" %}
2019-07-09 20:41:59 +08:00
local:
imageRepository: "{{ etcd_image_repo | regex_replace("/etcd$","") }}"
imageTag: "{{ etcd_image_tag }}"
2019-10-17 10:50:39 +08:00
dataDir: "{{ etcd_data_dir }}"
2019-07-09 20:41:59 +08:00
extraArgs:
metrics: {{ etcd_metrics }}
election-timeout: "{{ etcd_election_timeout }}"
heartbeat-interval: "{{ etcd_heartbeat_interval }}"
auto-compaction-retention: "{{ etcd_compaction_retention }}"
2023-08-09 02:06:16 +08:00
{% if etcd_listen_metrics_urls is defined %}
listen-metrics-urls: "{{ etcd_listen_metrics_urls }}"
{% endif %}
2019-07-09 20:41:59 +08:00
{% if etcd_snapshot_count is defined %}
snapshot-count: "{{ etcd_snapshot_count }}"
{% endif %}
{% if etcd_quota_backend_bytes is defined %}
quota-backend-bytes: "{{ etcd_quota_backend_bytes }}"
{% endif %}
2022-05-24 00:36:03 +08:00
{% if etcd_max_request_bytes is defined %}
max-request-bytes: "{{ etcd_max_request_bytes }}"
{% endif %}
2022-12-05 17:05:03 +08:00
{% if etcd_log_level is defined %}
log-level: "{{ etcd_log_level }}"
2019-07-09 20:41:59 +08:00
{% endif %}
{% for key, value in etcd_extra_vars.items() %}
{{ key }}: "{{ value }}"
{% endfor %}
serverCertSANs:
{% for san in etcd_cert_alt_names %}
- {{ san }}
{% endfor %}
{% for san in etcd_cert_alt_ips %}
- {{ san }}
{% endfor %}
peerCertSANs:
{% for san in etcd_cert_alt_names %}
- {{ san }}
{% endfor %}
{% for san in etcd_cert_alt_ips %}
- {{ san }}
{% endfor %}
{% endif %}
dns:
2023-07-05 11:36:54 +08:00
imageRepository: {{ coredns_image_repo | regex_replace('/coredns(?!/coredns).*$', '') }}
2019-07-09 20:41:59 +08:00
imageTag: {{ coredns_image_tag }}
2018-10-04 17:05:55 +08:00
networking:
dnsDomain: {{ dns_domain }}
2021-02-20 18:05:41 +08:00
serviceSubnet: "{{ kube_service_addresses }}{{ ',' + kube_service_addresses_ipv6 if enable_dual_stack_networks else '' }}"
2022-01-27 17:08:10 +08:00
{% if kube_network_plugin is defined and kube_network_plugin not in ["kube-ovn"] %}
2021-02-20 18:05:41 +08:00
podSubnet: "{{ kube_pods_subnet }}{{ ',' + kube_pods_subnet_ipv6 if enable_dual_stack_networks else '' }}"
2022-01-27 17:08:10 +08:00
{% endif %}
2021-04-12 16:05:59 +08:00
{% if kubeadm_feature_gates %}
2020-10-26 15:10:53 +08:00
featureGates:
2021-04-12 16:05:59 +08:00
{% for feature in kubeadm_feature_gates %}
2023-07-05 11:36:54 +08:00
{{ feature | replace("=", ": ") }}
2020-10-26 15:10:53 +08:00
{% endfor %}
{% endif %}
2018-10-04 17:05:55 +08:00
kubernetesVersion: {{ kube_version }}
2018-12-25 16:03:32 +08:00
{% if kubeadm_config_api_fqdn is defined %}
2018-10-04 17:05:55 +08:00
controlPlaneEndpoint: {{ kubeadm_config_api_fqdn }}:{{ loadbalancer_apiserver.port | default(kube_apiserver_port) }}
{% else %}
2019-03-05 19:04:39 +08:00
controlPlaneEndpoint: {{ ip | default(fallback_ips[inventory_hostname]) }}:{{ kube_apiserver_port }}
2018-10-04 17:05:55 +08:00
{% endif %}
2018-12-06 18:33:38 +08:00
certificatesDir: {{ kube_cert_dir }}
2018-11-27 21:03:03 +08:00
imageRepository: {{ kube_image_repo }}
2019-07-02 16:51:08 +08:00
apiServer:
extraArgs:
2023-11-27 12:37:33 +08:00
{% if kube_apiserver_etcd_compaction_interval is defined %}
etcd-compaction-interval: "{{ kube_apiserver_etcd_compaction_interval }}"
{% endif %}
2021-01-08 23:20:53 +08:00
{% if kube_apiserver_pod_eviction_not_ready_timeout_seconds is defined %}
default-not-ready-toleration-seconds: "{{ kube_apiserver_pod_eviction_not_ready_timeout_seconds }}"
{% endif %}
{% if kube_apiserver_pod_eviction_unreachable_timeout_seconds is defined %}
default-unreachable-toleration-seconds: "{{ kube_apiserver_pod_eviction_unreachable_timeout_seconds }}"
{% endif %}
2019-07-16 16:39:24 +08:00
{% if kube_api_anonymous_auth is defined %}
2019-07-02 16:51:08 +08:00
anonymous-auth: "{{ kube_api_anonymous_auth }}"
2019-05-08 03:52:34 +08:00
{% endif %}
2019-07-02 16:51:08 +08:00
authorization-mode: {{ authorization_modes | join(',') }}
bind-address: {{ kube_apiserver_bind_address }}
2023-07-05 11:36:54 +08:00
{% if kube_apiserver_enable_admission_plugins | length > 0 %}
2019-07-02 16:51:08 +08:00
enable-admission-plugins: {{ kube_apiserver_enable_admission_plugins | join(',') }}
2018-10-04 17:05:55 +08:00
{% endif %}
2022-05-03 02:03:15 +08:00
{% if kube_apiserver_admission_control_config_file %}
admission-control-config-file: {{ kube_config_dir }}/admission-controls.yaml
{% endif %}
2023-07-05 11:36:54 +08:00
{% if kube_apiserver_disable_admission_plugins | length > 0 %}
2019-07-02 16:51:08 +08:00
disable-admission-plugins: {{ kube_apiserver_disable_admission_plugins | join(',') }}
2018-10-04 17:05:55 +08:00
{% endif %}
2019-07-02 16:51:08 +08:00
apiserver-count: "{{ kube_apiserver_count }}"
endpoint-reconciler-type: lease
2018-10-04 17:05:55 +08:00
{% if etcd_events_cluster_enabled %}
2019-07-02 16:51:08 +08:00
etcd-servers-overrides: "/events#{{ etcd_events_access_addresses_semicolon }}"
2018-10-04 17:05:55 +08:00
{% endif %}
2019-07-02 16:51:08 +08:00
service-node-port-range: {{ kube_apiserver_node_port_range }}
2021-02-20 18:05:41 +08:00
service-cluster-ip-range: "{{ kube_service_addresses }}{{ ',' + kube_service_addresses_ipv6 if enable_dual_stack_networks else '' }}"
2019-07-02 16:51:08 +08:00
kubelet-preferred-address-types: "{{ kubelet_preferred_address_types }}"
profiling: "{{ kube_profiling }}"
request-timeout: "{{ kube_apiserver_request_timeout }}"
enable-aggregator-routing: "{{ kube_api_aggregator_routing }}"
2023-07-05 11:36:54 +08:00
{% if kube_token_auth | default(true) %}
2019-07-02 16:51:08 +08:00
token-auth-file: {{ kube_token_dir }}/known_tokens.csv
2018-11-14 02:25:59 +08:00
{% endif %}
2022-05-06 15:39:07 +08:00
{% if kube_apiserver_service_account_lookup %}
service-account-lookup: "{{ kube_apiserver_service_account_lookup }}"
{% endif %}
2023-07-05 11:36:54 +08:00
{% if kube_oidc_auth | default(false) and kube_oidc_url is defined and kube_oidc_client_id is defined %}
2019-12-05 16:24:32 +08:00
oidc-issuer-url: "{{ kube_oidc_url }}"
oidc-client-id: "{{ kube_oidc_client_id }}"
2018-10-04 17:05:55 +08:00
{% if kube_oidc_ca_file is defined %}
2019-12-05 16:24:32 +08:00
oidc-ca-file: "{{ kube_oidc_ca_file }}"
2018-10-04 17:05:55 +08:00
{% endif %}
{% if kube_oidc_username_claim is defined %}
2019-12-05 16:24:32 +08:00
oidc-username-claim: "{{ kube_oidc_username_claim }}"
2018-10-04 17:05:55 +08:00
{% endif %}
{% if kube_oidc_groups_claim is defined %}
2019-12-05 16:24:32 +08:00
oidc-groups-claim: "{{ kube_oidc_groups_claim }}"
2018-10-04 17:05:55 +08:00
{% endif %}
2019-02-01 07:31:43 +08:00
{% if kube_oidc_username_prefix is defined %}
2019-07-02 16:51:08 +08:00
oidc-username-prefix: "{{ kube_oidc_username_prefix }}"
2019-02-01 07:31:43 +08:00
{% endif %}
{% if kube_oidc_groups_prefix is defined %}
2019-07-02 16:51:08 +08:00
oidc-groups-prefix: "{{ kube_oidc_groups_prefix }}"
2019-02-01 07:31:43 +08:00
{% endif %}
2018-10-04 17:05:55 +08:00
{% endif %}
2023-07-05 11:36:54 +08:00
{% if kube_webhook_token_auth | default(false) %}
2019-07-02 16:51:08 +08:00
authentication-token-webhook-config-file: {{ kube_config_dir }}/webhook-token-auth-config.yaml
2018-12-26 17:52:53 +08:00
{% endif %}
2023-07-05 11:36:54 +08:00
{% if kube_webhook_authorization | default(false) %}
2020-08-24 21:29:41 +08:00
authorization-webhook-config-file: {{ kube_config_dir }}/webhook-authorization-config.yaml
{% endif %}
2018-10-04 17:05:55 +08:00
{% if kube_encrypt_secret_data %}
2019-07-02 16:51:08 +08:00
encryption-provider-config: {{ kube_cert_dir }}/secrets_encryption.yaml
2018-10-04 17:05:55 +08:00
{% endif %}
2019-07-02 16:51:08 +08:00
storage-backend: {{ kube_apiserver_storage_backend }}
2023-07-05 11:36:54 +08:00
{% if kube_api_runtime_config | length > 0 %}
2019-07-02 16:51:08 +08:00
runtime-config: {{ kube_api_runtime_config | join(',') }}
2018-10-04 17:05:55 +08:00
{% endif %}
2019-07-02 16:51:08 +08:00
allow-privileged: "true"
2020-09-25 00:26:06 +08:00
{% if kubernetes_audit or kubernetes_audit_webhook %}
audit-policy-file: {{ audit_policy_file }}
{% endif %}
2018-10-04 17:05:55 +08:00
{% if kubernetes_audit %}
2019-07-02 16:51:08 +08:00
audit-log-path: "{{ audit_log_path }}"
audit-log-maxage: "{{ audit_log_maxage }}"
audit-log-maxbackup: "{{ audit_log_maxbackups }}"
audit-log-maxsize: "{{ audit_log_maxsize }}"
2018-10-04 17:05:55 +08:00
{% endif %}
2020-07-20 16:32:54 +08:00
{% if kubernetes_audit_webhook %}
audit-webhook-config-file: {{ audit_webhook_config_file }}
audit-webhook-mode: {{ audit_webhook_mode }}
2021-04-08 22:52:56 +08:00
{% if audit_webhook_mode == "batch" %}
2020-07-20 16:32:54 +08:00
audit-webhook-batch-max-size: "{{ audit_webhook_batch_max_size }}"
audit-webhook-batch-max-wait: "{{ audit_webhook_batch_max_wait }}"
{% endif %}
2021-04-08 22:52:56 +08:00
{% endif %}
2018-10-04 17:05:55 +08:00
{% for key in kube_kubeadm_apiserver_extra_args %}
2019-07-02 16:51:08 +08:00
{{ key }}: "{{ kube_kubeadm_apiserver_extra_args[key] }}"
2018-10-04 17:05:55 +08:00
{% endfor %}
2022-04-05 20:39:37 +08:00
{% if kube_apiserver_feature_gates or kube_feature_gates %}
feature-gates: "{{ kube_apiserver_feature_gates | default(kube_feature_gates, true) | join(',') }}"
2018-10-04 17:05:55 +08:00
{% endif %}
2021-11-17 00:58:28 +08:00
{% if cloud_provider is defined and cloud_provider in ["openstack", "azure", "vsphere", "aws", "gce"] %}
2019-07-09 20:41:59 +08:00
cloud-provider: {{ cloud_provider }}
2019-07-02 16:51:08 +08:00
cloud-config: {{ kube_config_dir }}/cloud_config
2018-10-04 17:05:55 +08:00
{% endif %}
2020-06-16 19:10:05 +08:00
{% if tls_min_version is defined %}
tls-min-version: {{ tls_min_version }}
{% endif %}
{% if tls_cipher_suites is defined %}
tls-cipher-suites: {% for tls in tls_cipher_suites %}{{ tls }}{{ "," if not loop.last else "" }}{% endfor %}
{% endif %}
2020-06-24 23:15:17 +08:00
{% if event_ttl_duration is defined %}
event-ttl: {{ event_ttl_duration }}
2020-09-03 22:25:41 +08:00
{% endif %}
{% if kubelet_rotate_server_certificates %}
kubelet-certificate-authority: {{ kube_cert_dir }}/ca.crt
{% endif %}
2023-07-05 11:36:54 +08:00
{% if kubernetes_audit or kube_token_auth | default(true) or kube_webhook_token_auth | default(false) or ( cloud_provider is defined and cloud_provider in ["openstack", "azure", "vsphere", "aws", "gce"] ) or apiserver_extra_volumes or ssl_ca_dirs | length %}
2019-07-02 16:51:08 +08:00
extraVolumes:
2021-11-17 00:58:28 +08:00
{% if cloud_provider is defined and cloud_provider in ["openstack", "azure", "vsphere", "aws", "gce"] %}
2019-07-02 16:51:08 +08:00
- name: cloud-config
hostPath: {{ kube_config_dir }}/cloud_config
mountPath: {{ kube_config_dir }}/cloud_config
2018-11-27 21:03:03 +08:00
{% endif %}
2023-07-05 11:36:54 +08:00
{% if kube_token_auth | default(true) %}
2019-07-02 16:51:08 +08:00
- name: token-auth-config
hostPath: {{ kube_token_dir }}
mountPath: {{ kube_token_dir }}
2018-11-14 02:25:59 +08:00
{% endif %}
2023-07-05 11:36:54 +08:00
{% if kube_webhook_token_auth | default(false) %}
2019-07-02 16:51:08 +08:00
- name: webhook-token-auth-config
hostPath: {{ kube_config_dir }}/webhook-token-auth-config.yaml
mountPath: {{ kube_config_dir }}/webhook-token-auth-config.yaml
2018-12-26 17:52:53 +08:00
{% endif %}
2023-07-05 11:36:54 +08:00
{% if kube_webhook_authorization | default(false) %}
2020-08-24 21:29:41 +08:00
- name: webhook-authorization-config
hostPath: {{ kube_config_dir }}/webhook-authorization-config.yaml
mountPath: {{ kube_config_dir }}/webhook-authorization-config.yaml
{% endif %}
2020-07-20 16:32:54 +08:00
{% if kubernetes_audit or kubernetes_audit_webhook %}
2019-07-02 16:51:08 +08:00
- name: {{ audit_policy_name }}
hostPath: {{ audit_policy_hostpath }}
mountPath: {{ audit_policy_mountpath }}
2018-10-04 17:05:55 +08:00
{% if audit_log_path != "-" %}
2019-07-02 16:51:08 +08:00
- name: {{ audit_log_name }}
hostPath: {{ audit_log_hostpath }}
mountPath: {{ audit_log_mountpath }}
readOnly: false
2018-10-04 17:05:55 +08:00
{% endif %}
{% endif %}
2022-05-03 02:03:15 +08:00
{% if kube_apiserver_admission_control_config_file %}
- name: admission-control-configs
hostPath: {{ kube_config_dir }}/admission-controls
mountPath: {{ kube_config_dir }}
readOnly: false
pathType: DirectoryOrCreate
{% endif %}
2018-11-29 15:16:55 +08:00
{% for volume in apiserver_extra_volumes %}
2019-07-02 16:51:08 +08:00
- name: {{ volume.name }}
hostPath: {{ volume.hostPath }}
mountPath: {{ volume.mountPath }}
readOnly: {{ volume.readOnly | d(not (volume.writable | d(false))) }}
2018-11-29 15:16:55 +08:00
{% endfor %}
2023-07-05 11:36:54 +08:00
{% if ssl_ca_dirs | length %}
2018-12-28 01:15:37 +08:00
{% for dir in ssl_ca_dirs %}
2019-07-02 16:51:08 +08:00
- name: {{ dir | regex_replace('^/(.*)$', '\\1' ) | regex_replace('/', '-') }}
hostPath: {{ dir }}
mountPath: {{ dir }}
readOnly: true
{% endfor %}
{% endif %}
{% endif %}
certSANs:
{% for san in apiserver_sans %}
- {{ san }}
{% endfor %}
timeoutForControlPlane: 5m0s
controllerManager:
extraArgs:
node-monitor-grace-period: {{ kube_controller_node_monitor_grace_period }}
node-monitor-period: {{ kube_controller_node_monitor_period }}
2022-01-27 17:08:10 +08:00
{% if kube_network_plugin is defined and kube_network_plugin not in ["kube-ovn"] %}
2021-02-20 18:05:41 +08:00
cluster-cidr: "{{ kube_pods_subnet }}{{ ',' + kube_pods_subnet_ipv6 if enable_dual_stack_networks else '' }}"
2022-01-27 17:08:10 +08:00
{% endif %}
2021-02-20 18:05:41 +08:00
service-cluster-ip-range: "{{ kube_service_addresses }}{{ ',' + kube_service_addresses_ipv6 if enable_dual_stack_networks else '' }}"
2023-12-12 21:38:36 +08:00
{% if kube_network_plugin is defined and kube_network_plugin == "calico" and not calico_ipam_host_local %}
allocate-node-cidrs: "false"
{% else %}
2020-10-26 15:10:53 +08:00
{% if enable_dual_stack_networks %}
node-cidr-mask-size-ipv4: "{{ kube_network_node_prefix }}"
node-cidr-mask-size-ipv6: "{{ kube_network_node_prefix_ipv6 }}"
{% else %}
2019-07-02 16:51:08 +08:00
node-cidr-mask-size: "{{ kube_network_node_prefix }}"
2023-12-12 21:38:36 +08:00
{% endif %}
2020-10-26 15:10:53 +08:00
{% endif %}
2019-07-02 16:51:08 +08:00
profiling: "{{ kube_profiling }}"
terminated-pod-gc-threshold: "{{ kube_controller_terminated_pod_gc_threshold }}"
bind-address: {{ kube_controller_manager_bind_address }}
2020-09-25 23:21:11 +08:00
leader-elect-lease-duration: {{ kube_controller_manager_leader_elect_lease_duration }}
leader-elect-renew-deadline: {{ kube_controller_manager_leader_elect_renew_deadline }}
2022-04-05 20:39:37 +08:00
{% if kube_controller_feature_gates or kube_feature_gates %}
feature-gates: "{{ kube_controller_feature_gates | default(kube_feature_gates, true) | join(',') }}"
2019-07-02 16:51:08 +08:00
{% endif %}
{% for key in kube_kubeadm_controller_extra_args %}
{{ key }}: "{{ kube_kubeadm_controller_extra_args[key] }}"
2018-12-28 01:15:37 +08:00
{% endfor %}
2021-11-17 00:58:28 +08:00
{% if cloud_provider is defined and cloud_provider in ["openstack", "azure", "vsphere", "aws", "gce"] %}
2019-07-09 20:41:59 +08:00
cloud-provider: {{ cloud_provider }}
2019-07-02 16:51:08 +08:00
cloud-config: {{ kube_config_dir }}/cloud_config
2018-12-28 01:15:37 +08:00
{% endif %}
2019-07-02 16:51:08 +08:00
{% if kube_network_plugin is defined and kube_network_plugin not in ["cloud"] %}
configure-cloud-routes: "false"
2018-11-14 02:25:59 +08:00
{% endif %}
2020-04-08 16:41:43 +08:00
{% if kubelet_flexvolumes_plugins_dir is defined %}
2023-07-05 11:36:54 +08:00
flex-volume-plugin-dir: {{ kubelet_flexvolumes_plugins_dir }}
2020-04-08 16:41:43 +08:00
{% endif %}
2020-06-16 19:10:05 +08:00
{% if tls_min_version is defined %}
tls-min-version: {{ tls_min_version }}
{% endif %}
{% if tls_cipher_suites is defined %}
tls-cipher-suites: {% for tls in tls_cipher_suites %}{{ tls }}{{ "," if not loop.last else "" }}{% endfor %}
{% endif %}
2021-11-17 00:58:28 +08:00
{% if cloud_provider is defined and cloud_provider in ["openstack", "azure", "vsphere", "aws", "gce"] or controller_manager_extra_volumes %}
2019-07-02 16:51:08 +08:00
extraVolumes:
2018-11-27 21:03:03 +08:00
{% if cloud_provider is defined and cloud_provider in ["openstack"] and openstack_cacert is defined %}
2019-07-02 16:51:08 +08:00
- name: openstackcacert
hostPath: "{{ kube_config_dir }}/openstack-cacert.pem"
mountPath: "{{ kube_config_dir }}/openstack-cacert.pem"
2018-11-27 21:03:03 +08:00
{% endif %}
2021-11-17 00:58:28 +08:00
{% if cloud_provider is defined and cloud_provider in ["openstack", "azure", "vsphere", "aws", "gce"] %}
2019-07-02 16:51:08 +08:00
- name: cloud-config
hostPath: {{ kube_config_dir }}/cloud_config
mountPath: {{ kube_config_dir }}/cloud_config
2018-10-04 17:05:55 +08:00
{% endif %}
2018-11-29 15:16:55 +08:00
{% for volume in controller_manager_extra_volumes %}
2019-07-02 16:51:08 +08:00
- name: {{ volume.name }}
hostPath: {{ volume.hostPath }}
mountPath: {{ volume.mountPath }}
readOnly: {{ volume.readOnly | d(not (volume.writable | d(false))) }}
{% endfor %}
{% endif %}
scheduler:
extraArgs:
bind-address: {{ kube_scheduler_bind_address }}
2021-04-06 15:35:35 +08:00
config: {{ kube_config_dir }}/kubescheduler-config.yaml
2022-04-05 20:39:37 +08:00
{% if kube_scheduler_feature_gates or kube_feature_gates %}
feature-gates: "{{ kube_scheduler_feature_gates | default(kube_feature_gates, true) | join(',') }}"
2019-07-02 16:51:08 +08:00
{% endif %}
2023-04-18 09:54:58 +08:00
profiling: "{{ kube_profiling }}"
2023-07-05 11:36:54 +08:00
{% if kube_kubeadm_scheduler_extra_args | length > 0 %}
2019-07-02 16:51:08 +08:00
{% for key in kube_kubeadm_scheduler_extra_args %}
{{ key }}: "{{ kube_kubeadm_scheduler_extra_args[key] }}"
2018-11-29 15:16:55 +08:00
{% endfor %}
2020-06-16 19:10:05 +08:00
{% endif %}
{% if tls_min_version is defined %}
tls-min-version: {{ tls_min_version }}
{% endif %}
{% if tls_cipher_suites is defined %}
tls-cipher-suites: {% for tls in tls_cipher_suites %}{{ tls }}{{ "," if not loop.last else "" }}{% endfor %}
2018-11-29 15:16:55 +08:00
{% endif %}
2019-07-02 16:51:08 +08:00
extraVolumes:
2021-04-06 15:35:35 +08:00
- name: kubescheduler-config
hostPath: {{ kube_config_dir }}/kubescheduler-config.yaml
mountPath: {{ kube_config_dir }}/kubescheduler-config.yaml
readOnly: true
2021-04-21 06:34:33 +08:00
{% if scheduler_extra_volumes %}
2018-11-29 15:16:55 +08:00
{% for volume in scheduler_extra_volumes %}
2019-07-02 16:51:08 +08:00
- name: {{ volume.name }}
hostPath: {{ volume.hostPath }}
mountPath: {{ volume.mountPath }}
readOnly: {{ volume.readOnly | d(not (volume.writable | d(false))) }}
2018-11-29 15:16:55 +08:00
{% endfor %}
2018-10-04 17:05:55 +08:00
{% endif %}
---
apiVersion: kubeproxy.config.k8s.io/v1alpha1
kind: KubeProxyConfiguration
2019-01-03 16:04:26 +08:00
bindAddress: {{ kube_proxy_bind_address }}
2018-10-04 17:05:55 +08:00
clientConnection:
2020-06-30 03:39:59 +08:00
acceptContentTypes: {{ kube_proxy_client_accept_content_types }}
burst: {{ kube_proxy_client_burst }}
contentType: {{ kube_proxy_client_content_type }}
kubeconfig: {{ kube_proxy_client_kubeconfig }}
qps: {{ kube_proxy_client_qps }}
2022-01-27 17:08:10 +08:00
{% if kube_network_plugin is defined and kube_network_plugin not in ["kube-ovn"] %}
2021-02-20 18:05:41 +08:00
clusterCIDR: "{{ kube_pods_subnet }}{{ ',' + kube_pods_subnet_ipv6 if enable_dual_stack_networks else '' }}"
2022-01-27 17:08:10 +08:00
{% endif %}
2019-01-03 16:04:26 +08:00
configSyncPeriod: {{ kube_proxy_config_sync_period }}
2018-10-04 17:05:55 +08:00
conntrack:
2020-06-30 03:39:59 +08:00
maxPerCore: {{ kube_proxy_conntrack_max_per_core }}
min: {{ kube_proxy_conntrack_min }}
tcpCloseWaitTimeout: {{ kube_proxy_conntrack_tcp_close_wait_timeout }}
tcpEstablishedTimeout: {{ kube_proxy_conntrack_tcp_established_timeout }}
2019-01-03 16:04:26 +08:00
enableProfiling: {{ kube_proxy_enable_profiling }}
healthzBindAddress: {{ kube_proxy_healthz_bind_address }}
2019-02-07 14:20:11 +08:00
hostnameOverride: {{ kube_override_hostname }}
2018-10-04 17:05:55 +08:00
iptables:
2020-06-30 03:39:59 +08:00
masqueradeAll: {{ kube_proxy_masquerade_all }}
masqueradeBit: {{ kube_proxy_masquerade_bit }}
minSyncPeriod: {{ kube_proxy_min_sync_period }}
syncPeriod: {{ kube_proxy_sync_period }}
2018-10-04 17:05:55 +08:00
ipvs:
2020-06-30 03:39:59 +08:00
excludeCIDRs: {{ kube_proxy_exclude_cidrs }}
minSyncPeriod: {{ kube_proxy_min_sync_period }}
scheduler: {{ kube_proxy_scheduler }}
syncPeriod: {{ kube_proxy_sync_period }}
strictARP: {{ kube_proxy_strict_arp }}
2020-08-01 15:33:40 +08:00
tcpTimeout: {{ kube_proxy_tcp_timeout }}
tcpFinTimeout: {{ kube_proxy_tcp_fin_timeout }}
udpTimeout: {{ kube_proxy_udp_timeout }}
2019-01-03 16:04:26 +08:00
metricsBindAddress: {{ kube_proxy_metrics_bind_address }}
2018-10-04 17:05:55 +08:00
mode: {{ kube_proxy_mode }}
2019-01-03 16:04:26 +08:00
nodePortAddresses: {{ kube_proxy_nodeport_addresses }}
oomScoreAdj: {{ kube_proxy_oom_score_adj }}
portRange: {{ kube_proxy_port_range }}
2022-04-05 20:39:37 +08:00
{% if kube_proxy_feature_gates or kube_feature_gates %}
{% set feature_gates = ( kube_proxy_feature_gates | default(kube_feature_gates, true) ) %}
2020-10-22 18:39:34 +08:00
featureGates:
2022-04-05 20:39:37 +08:00
{% for feature in feature_gates %}
2023-07-05 11:36:54 +08:00
{{ feature | replace("=", ": ") }}
2020-11-03 01:55:38 +08:00
{% endfor %}
2020-10-22 18:39:34 +08:00
{% endif %}
2019-10-25 17:23:40 +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 %}
---
apiVersion: kubelet.config.k8s.io/v1beta1
kind: KubeletConfiguration
clusterDNS:
{% for dns_address in kubelet_cluster_dns %}
- {{ dns_address }}
{% endfor %}
2022-04-05 20:39:37 +08:00
{% if kubelet_feature_gates or kube_feature_gates %}
{% set feature_gates = ( kubelet_feature_gates | default(kube_feature_gates, true) ) %}
2020-10-26 15:10:53 +08:00
featureGates:
2022-04-05 20:39:37 +08:00
{% for feature in feature_gates %}
2023-07-05 11:36:54 +08:00
{{ feature | replace("=", ": ") }}
2020-10-26 15:10:53 +08:00
{% endfor %}
{% endif %}