You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

682 lines
26 KiB

  1. ---
  2. # Use proxycommand if bastion host is in group all
  3. # This change obseletes editing ansible.cfg file depending on bastion existence
  4. ansible_ssh_common_args: "{% if 'bastion' in groups['all'] %} -o ProxyCommand='ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -W %h:%p -p {{ hostvars['bastion']['ansible_port'] | default(22) }} {{ hostvars['bastion']['ansible_user'] }}@{{ hostvars['bastion']['ansible_host'] }} {% if ansible_ssh_private_key_file is defined %}-i {{ ansible_ssh_private_key_file }}{% endif %} ' {% endif %}"
  5. # selinux state
  6. preinstall_selinux_state: permissive
  7. # Setting this value to false will fail
  8. # For details, read this comment https://github.com/kubernetes-sigs/kubespray/pull/11016#issuecomment-2004985001
  9. kube_api_anonymous_auth: true
  10. # Default value, but will be set to true automatically if detected
  11. is_fedora_coreos: false
  12. # Swap settings
  13. kubelet_fail_swap_on: true
  14. kubelet_swap_behavior: LimitedSwap
  15. ## Change this to use another Kubernetes version, e.g. a current beta release
  16. kube_version: v1.30.4
  17. ## The minimum version working
  18. kube_version_min_required: v1.28.0
  19. ## Kube Proxy mode One of ['iptables', 'ipvs']
  20. kube_proxy_mode: ipvs
  21. ## The timeout for init first control-plane
  22. kubeadm_init_timeout: 300s
  23. ## List of kubeadm init phases that should be skipped during control plane setup
  24. ## By default 'addon/coredns' is skipped
  25. ## 'addon/kube-proxy' gets skipped for some network plugins
  26. kubeadm_init_phases_skip_default: [ "addon/coredns" ]
  27. kubeadm_init_phases_skip: >-
  28. {%- if kube_network_plugin == 'kube-router' and (kube_router_run_service_proxy is defined and kube_router_run_service_proxy) -%}
  29. {{ kubeadm_init_phases_skip_default + ["addon/kube-proxy"] }}
  30. {%- elif kube_network_plugin == 'cilium' and (cilium_kube_proxy_replacement is defined and cilium_kube_proxy_replacement == 'strict') -%}
  31. {{ kubeadm_init_phases_skip_default + ["addon/kube-proxy"] }}
  32. {%- elif kube_network_plugin == 'calico' and (calico_bpf_enabled is defined and calico_bpf_enabled) -%}
  33. {{ kubeadm_init_phases_skip_default + ["addon/kube-proxy"] }}
  34. {%- elif kube_proxy_remove is defined and kube_proxy_remove -%}
  35. {{ kubeadm_init_phases_skip_default + ["addon/kube-proxy"] }}
  36. {%- else -%}
  37. {{ kubeadm_init_phases_skip_default }}
  38. {%- endif -%}
  39. # List of kubeadm phases that should be skipped when joining a new node
  40. # You may need to set this to ['preflight'] for air-gaped deployments to avoid failing connectivity tests.
  41. kubeadm_join_phases_skip_default: []
  42. kubeadm_join_phases_skip: >-
  43. {{ kubeadm_join_phases_skip_default }}
  44. # Set to true to remove the role binding to anonymous users created by kubeadm
  45. remove_anonymous_access: false
  46. # A string slice of values which specify the addresses to use for NodePorts.
  47. # Values may be valid IP blocks (e.g. 1.2.3.0/24, 1.2.3.4/32).
  48. # The default empty string slice ([]) means to use all local addresses.
  49. # kube_proxy_nodeport_addresses_cidr is retained for legacy config
  50. kube_proxy_nodeport_addresses: >-
  51. {%- if kube_proxy_nodeport_addresses_cidr is defined -%}
  52. [{{ kube_proxy_nodeport_addresses_cidr }}]
  53. {%- else -%}
  54. []
  55. {%- endif -%}
  56. # Set to true to allow pre-checks to fail and continue deployment
  57. ignore_assert_errors: false
  58. kube_vip_enabled: false
  59. # nginx-proxy configure
  60. nginx_config_dir: "/etc/nginx"
  61. # haproxy configure
  62. haproxy_config_dir: "/etc/haproxy"
  63. # Directory where the binaries will be installed
  64. bin_dir: /usr/local/bin
  65. docker_bin_dir: /usr/bin
  66. containerd_bin_dir: "{{ bin_dir }}"
  67. etcd_data_dir: /var/lib/etcd
  68. # Where the binaries will be downloaded.
  69. # Note: ensure that you've enough disk space (about 1G)
  70. local_release_dir: "/tmp/releases"
  71. # Random shifts for retrying failed ops like pushing/downloading
  72. retry_stagger: 5
  73. # Install epel repo on Centos/RHEL
  74. epel_enabled: false
  75. # DNS configuration.
  76. # Kubernetes cluster name, also will be used as DNS domain
  77. cluster_name: cluster.local
  78. # Subdomains of DNS domain to be resolved via /etc/resolv.conf for hostnet pods
  79. ndots: 2
  80. # Default resolv.conf options
  81. docker_dns_options:
  82. - ndots:{{ ndots }}
  83. - timeout:2
  84. - attempts:2
  85. # Can be coredns, coredns_dual, manual, or none
  86. dns_mode: coredns
  87. # Enable dns autoscaler
  88. enable_dns_autoscaler: true
  89. # Enable nodelocal dns cache
  90. enable_nodelocaldns: true
  91. enable_nodelocaldns_secondary: false
  92. nodelocaldns_ip: 169.254.25.10
  93. nodelocaldns_health_port: 9254
  94. nodelocaldns_second_health_port: 9256
  95. nodelocaldns_bind_metrics_host_ip: false
  96. nodelocaldns_secondary_skew_seconds: 5
  97. # Should be set to a cluster IP if using a custom cluster DNS
  98. manual_dns_server: ""
  99. # Can be host_resolvconf, docker_dns or none
  100. resolvconf_mode: host_resolvconf
  101. # Deploy netchecker app to verify DNS resolve as an HTTP service
  102. deploy_netchecker: false
  103. # Ip address of the kubernetes DNS service (called skydns for historical reasons)
  104. skydns_server: "{{ kube_service_addresses | ansible.utils.ipaddr('net') | ansible.utils.ipaddr(3) | ansible.utils.ipaddr('address') }}"
  105. skydns_server_secondary: "{{ kube_service_addresses | ansible.utils.ipaddr('net') | ansible.utils.ipaddr(4) | ansible.utils.ipaddr('address') }}"
  106. dns_domain: "{{ cluster_name }}"
  107. docker_dns_search_domains:
  108. - 'default.svc.{{ dns_domain }}'
  109. - 'svc.{{ dns_domain }}'
  110. kube_dns_servers:
  111. coredns: ["{{ skydns_server }}"]
  112. coredns_dual: "{{ [skydns_server] + [skydns_server_secondary] }}"
  113. manual: ["{{ manual_dns_server }}"]
  114. dns_servers: "{{ kube_dns_servers[dns_mode] }}"
  115. enable_coredns_k8s_external: false
  116. coredns_k8s_external_zone: k8s_external.local
  117. enable_coredns_k8s_endpoint_pod_names: false
  118. # Kubernetes configuration dirs and system namespace.
  119. # Those are where all the additional config stuff goes
  120. # the kubernetes normally puts in /srv/kubernetes.
  121. # This puts them in a sane location and namespace.
  122. # Editing those values will almost surely break something.
  123. kube_config_dir: /etc/kubernetes
  124. kube_script_dir: "{{ bin_dir }}/kubernetes-scripts"
  125. kube_manifest_dir: "{{ kube_config_dir }}/manifests"
  126. # Kubectl command
  127. # This is for consistency when using kubectl command in roles, and ensure
  128. kubectl: "{{ bin_dir }}/kubectl --kubeconfig {{ kube_config_dir }}/admin.conf"
  129. # This is where all the cert scripts and certs will be located
  130. kube_cert_dir: "{{ kube_config_dir }}/ssl"
  131. # compatibility directory for kubeadm
  132. kube_cert_compat_dir: "/etc/kubernetes/pki"
  133. # This is where all of the bearer tokens will be stored
  134. kube_token_dir: "{{ kube_config_dir }}/tokens"
  135. # This is the user that owns the cluster installation.
  136. kube_owner: kube
  137. # This is the group that the cert creation scripts chgrp the
  138. # cert files to. Not really changeable...
  139. kube_cert_group: kube-cert
  140. # Set to true when the CAs are managed externally.
  141. # When true, disables all tasks manipulating certificates. Ensure before the kubespray run that:
  142. # - Certificates and CAs are present in kube_cert_dir
  143. # - Kubeconfig files are present in kube_config_dir
  144. kube_external_ca_mode: false
  145. # Cluster Loglevel configuration
  146. kube_log_level: 2
  147. # Choose network plugin (cilium, calico, kube-ovn, weave or flannel. Use cni for generic cni plugin)
  148. # Can also be set to 'cloud', which lets the cloud provider setup appropriate routing
  149. kube_network_plugin: calico
  150. kube_network_plugin_multus: false
  151. # Determines if calico_rr group exists
  152. peer_with_calico_rr: "{{ 'calico_rr' in groups and groups['calico_rr'] | length > 0 }}"
  153. # Choose data store type for calico: "etcd" or "kdd" (kubernetes datastore)
  154. calico_datastore: "kdd"
  155. # Kubernetes internal network for services, unused block of space.
  156. kube_service_addresses: 10.233.0.0/18
  157. # internal network. When used, it will assign IP
  158. # addresses from this range to individual pods.
  159. # This network must be unused in your network infrastructure!
  160. kube_pods_subnet: 10.233.64.0/18
  161. # internal network node size allocation (optional). This is the size allocated
  162. # to each node for pod IP address allocation. Note that the number of pods per node is
  163. # also limited by the kubelet_max_pods variable which defaults to 110.
  164. #
  165. # Example:
  166. # Up to 64 nodes and up to 254 or kubelet_max_pods (the lowest of the two) pods per node:
  167. # - kube_pods_subnet: 10.233.64.0/18
  168. # - kube_network_node_prefix: 24
  169. # - kubelet_max_pods: 110
  170. #
  171. # Example:
  172. # Up to 128 nodes and up to 126 or kubelet_max_pods (the lowest of the two) pods per node:
  173. # - kube_pods_subnet: 10.233.64.0/18
  174. # - kube_network_node_prefix: 25
  175. # - kubelet_max_pods: 110
  176. kube_network_node_prefix: 24
  177. # Configure Dual Stack networking (i.e. both IPv4 and IPv6)
  178. enable_dual_stack_networks: false
  179. # Kubernetes internal network for IPv6 services, unused block of space.
  180. # This is only used if enable_dual_stack_networks is set to true
  181. # This provides 4096 IPv6 IPs
  182. kube_service_addresses_ipv6: fd85:ee78:d8a6:8607::1000/116
  183. # Internal network. When used, it will assign IPv6 addresses from this range to individual pods.
  184. # This network must not already be in your network infrastructure!
  185. # This is only used if enable_dual_stack_networks is set to true.
  186. # This provides room for 256 nodes with 254 pods per node.
  187. kube_pods_subnet_ipv6: fd85:ee78:d8a6:8607::1:0000/112
  188. # IPv6 subnet size allocated to each for pods.
  189. # This is only used if enable_dual_stack_networks is set to true
  190. # This provides room for 254 pods per node.
  191. kube_network_node_prefix_ipv6: 120
  192. # The virtual cluster IP, real host IPs and ports the API Server will be
  193. # listening on.
  194. # NOTE: loadbalancer_apiserver_localhost somewhat alters the final API enpdoint
  195. # access IP value (automatically evaluated below)
  196. kube_apiserver_ip: "{{ kube_service_addresses | ansible.utils.ipaddr('net') | ansible.utils.ipaddr(1) | ansible.utils.ipaddr('address') }}"
  197. # NOTE: If you specific address/interface and use loadbalancer_apiserver_localhost
  198. # loadbalancer_apiserver_localhost (nginx/haproxy) will deploy on control plane nodes on 127.0.0.1:{{ loadbalancer_apiserver_port | default(kube_apiserver_port) }} too.
  199. kube_apiserver_bind_address: 0.0.0.0
  200. # https
  201. kube_apiserver_port: 6443
  202. # If non-empty, will use this string as identification instead of the actual hostname
  203. kube_override_hostname: >-
  204. {%- if cloud_provider is defined and cloud_provider in ['aws'] -%}
  205. {%- else -%}
  206. {{ inventory_hostname }}
  207. {%- endif -%}
  208. # define kubelet config dir for dynamic kubelet
  209. # kubelet_config_dir:
  210. default_kubelet_config_dir: "{{ kube_config_dir }}/dynamic_kubelet_dir"
  211. # Aggregator
  212. kube_api_aggregator_routing: false
  213. # Profiling
  214. kube_profiling: false
  215. # Graceful Node Shutdown
  216. kubelet_shutdown_grace_period: 60s
  217. # kubelet_shutdown_grace_period_critical_pods should be less than kubelet_shutdown_grace_period
  218. # to give normal pods time to be gracefully evacuated
  219. kubelet_shutdown_grace_period_critical_pods: 20s
  220. # Whether to deploy the container engine
  221. deploy_container_engine: "{{ inventory_hostname in groups['k8s_cluster'] or etcd_deployment_type == 'docker' }}"
  222. # Container for runtime
  223. container_manager: containerd
  224. # Enable Node Resource Interface in containerd or CRI-O. Requires crio_version >= v1.26.0
  225. # or containerd_version >= 1.7.0.
  226. nri_enabled: false
  227. # Enable Kata Containers as additional container runtime
  228. # When enabled, it requires `container_manager` different than Docker
  229. kata_containers_enabled: false
  230. # Enable gVisor as an additional container runtime
  231. # gVisor is only supported with container_manager Docker or containerd
  232. gvisor_enabled: false
  233. # Enable crun as additional container runtime
  234. # When enabled, it requires container_manager=crio
  235. crun_enabled: false
  236. # Enable youki as additional container runtime
  237. # When enabled, it requires container_manager=crio
  238. youki_enabled: false
  239. # Container on localhost (download images when download_localhost is true)
  240. container_manager_on_localhost: "{{ container_manager }}"
  241. # CRI socket path
  242. cri_socket: >-
  243. {%- if container_manager == 'crio' -%}
  244. unix:///var/run/crio/crio.sock
  245. {%- elif container_manager == 'containerd' -%}
  246. unix:///var/run/containerd/containerd.sock
  247. {%- elif container_manager == 'docker' -%}
  248. unix:///var/run/cri-dockerd.sock
  249. {%- endif -%}
  250. crio_insecure_registries: []
  251. ## Uncomment this if you want to force overlay/overlay2 as docker storage driver
  252. ## Please note that overlay2 is only supported on newer kernels
  253. # docker_storage_options: -s overlay2
  254. ## Only set this if you have more than 3 nameservers:
  255. ## If true Kubespray will only use the first 3, otherwise it will fail
  256. docker_dns_servers_strict: false
  257. # Path used to store Docker data
  258. docker_daemon_graph: "/var/lib/docker"
  259. ## Used to set docker daemon iptables options to true
  260. docker_iptables_enabled: "false"
  261. # Docker log options
  262. # Rotate container stderr/stdout logs at 50m and keep last 5
  263. docker_log_opts: "--log-opt max-size=50m --log-opt max-file=5"
  264. ## A list of insecure docker registries (IP address or domain name), for example
  265. ## to allow insecure-registry access to self-hosted registries. Empty by default.
  266. # docker_insecure_registries:
  267. # - mirror.registry.io
  268. # - 172.19.16.11
  269. docker_insecure_registries: []
  270. ## A list of additional registry mirrors, for example China registry mirror. Empty by default.
  271. # docker_registry_mirrors:
  272. # - https://registry.docker-cn.com
  273. # - https://mirror.aliyuncs.com
  274. docker_registry_mirrors: []
  275. ## If non-empty will override default system MounFlags value.
  276. ## This option takes a mount propagation flag: shared, slave
  277. ## or private, which control whether mounts in the file system
  278. ## namespace set up for docker will receive or propagate mounts
  279. ## and unmounts. Leave empty for system default
  280. # docker_mount_flags:
  281. ## A string of extra options to pass to the docker daemon.
  282. # docker_options: ""
  283. ## A list of plugins to install using 'docker plugin install --grant-all-permissions'
  284. ## Empty by default so no plugins will be installed.
  285. docker_plugins: []
  286. # Containerd options - thse are relevant when container_manager == 'containerd'
  287. containerd_use_systemd_cgroup: true
  288. # Containerd conf default dir
  289. containerd_storage_dir: "/var/lib/containerd"
  290. containerd_state_dir: "/run/containerd"
  291. containerd_systemd_dir: "/etc/systemd/system/containerd.service.d"
  292. containerd_cfg_dir: "/etc/containerd"
  293. # Settings for containerized control plane (etcd/kubelet/secrets)
  294. # deployment type for legacy etcd mode
  295. etcd_deployment_type: host
  296. cert_management: script
  297. # Make a copy of kubeconfig on the host that runs Ansible in {{ inventory_dir }}/artifacts
  298. kubeconfig_localhost: false
  299. # Download kubectl onto the host that runs Ansible in {{ bin_dir }}
  300. kubectl_localhost: false
  301. # Define credentials_dir here so it can be overridden
  302. credentials_dir: "{{ inventory_dir }}/credentials"
  303. # K8s image pull policy (imagePullPolicy)
  304. k8s_image_pull_policy: IfNotPresent
  305. # Kubernetes dashboard
  306. # RBAC required. see docs/getting-started.md for access details.
  307. dashboard_enabled: false
  308. # Addons which can be enabled
  309. helm_enabled: false
  310. krew_enabled: false
  311. registry_enabled: false
  312. metrics_server_enabled: false
  313. enable_network_policy: true
  314. local_path_provisioner_enabled: false
  315. local_volume_provisioner_enabled: false
  316. local_volume_provisioner_directory_mode: "0700"
  317. cinder_csi_enabled: false
  318. aws_ebs_csi_enabled: false
  319. azure_csi_enabled: false
  320. gcp_pd_csi_enabled: false
  321. vsphere_csi_enabled: false
  322. upcloud_csi_enabled: false
  323. csi_snapshot_controller_enabled: false
  324. persistent_volumes_enabled: false
  325. cephfs_provisioner_enabled: false
  326. rbd_provisioner_enabled: false
  327. ingress_nginx_enabled: false
  328. ingress_alb_enabled: false
  329. cert_manager_enabled: false
  330. expand_persistent_volumes: false
  331. metallb_enabled: false
  332. metallb_speaker_enabled: "{{ metallb_enabled }}"
  333. argocd_enabled: false
  334. ## When OpenStack is used, Cinder version can be explicitly specified if autodetection fails (Fixed in 1.9: https://github.com/kubernetes/kubernetes/issues/50461)
  335. # openstack_blockstorage_version: "v1/v2/auto (default)"
  336. openstack_blockstorage_ignore_volume_az: "{{ volume_cross_zone_attachment | default('false') }}"
  337. # set max volumes per node (cinder-csi), default not set
  338. # node_volume_attach_limit: 25
  339. # Cinder CSI topology, when false volumes can be cross-mounted between availability zones
  340. # cinder_topology: false
  341. # Set Cinder topology zones (can be multiple zones, default not set)
  342. # cinder_topology_zones:
  343. # - nova
  344. cinder_csi_ignore_volume_az: "{{ volume_cross_zone_attachment | default('false') }}"
  345. ## When OpenStack is used, if LBaaSv2 is available you can enable it with the following 2 variables.
  346. openstack_lbaas_enabled: false
  347. # openstack_lbaas_subnet_id: "Neutron subnet ID (not network ID) to create LBaaS VIP"
  348. ## To enable automatic floating ip provisioning, specify a subnet.
  349. # openstack_lbaas_floating_network_id: "Neutron network ID (not subnet ID) to get floating IP from, disabled by default"
  350. ## Override default LBaaS behavior
  351. # openstack_lbaas_use_octavia: False
  352. # openstack_lbaas_method: "ROUND_ROBIN"
  353. # openstack_lbaas_provider: "haproxy"
  354. openstack_lbaas_create_monitor: "yes"
  355. openstack_lbaas_monitor_delay: "1m"
  356. openstack_lbaas_monitor_timeout: "30s"
  357. openstack_lbaas_monitor_max_retries: "3"
  358. openstack_cacert: "{{ lookup('env', 'OS_CACERT') }}"
  359. # Default values for the external OpenStack Cloud Controller
  360. external_openstack_lbaas_enabled: true
  361. external_openstack_network_ipv6_disabled: false
  362. external_openstack_network_internal_networks: []
  363. external_openstack_network_public_networks: []
  364. # Default values for the external Hcloud Cloud Controller
  365. external_hcloud_cloud:
  366. hcloud_api_token: ""
  367. token_secret_name: hcloud
  368. service_account_name: cloud-controller-manager
  369. controller_image_tag: "latest"
  370. ## A dictionary of extra arguments to add to the openstack cloud controller manager daemonset
  371. ## Format:
  372. ## external_hcloud_cloud.controller_extra_args:
  373. ## arg1: "value1"
  374. ## arg2: "value2"
  375. controller_extra_args: {}
  376. ## List of authorization modes that must be configured for
  377. ## the k8s cluster. Only 'AlwaysAllow', 'AlwaysDeny', 'Node' and
  378. ## 'RBAC' modes are tested. Order is important.
  379. authorization_modes: ['Node', 'RBAC']
  380. rbac_enabled: "{{ 'RBAC' in authorization_modes }}"
  381. # When enabled, API bearer tokens (including service account tokens) can be used to authenticate to the kubelet's HTTPS endpoint
  382. kubelet_authentication_token_webhook: true
  383. # When enabled, access to the kubelet API requires authorization by delegation to the API server
  384. kubelet_authorization_mode_webhook: true
  385. # kubelet uses certificates for authenticating to the Kubernetes API
  386. # Automatically generate a new key and request a new certificate from the Kubernetes API as the current certificate approaches expiration
  387. kubelet_rotate_certificates: true
  388. # kubelet can also request a new server certificate from the Kubernetes API
  389. kubelet_rotate_server_certificates: false
  390. # If set to true, kubelet errors if any of kernel tunables is different than kubelet defaults
  391. kubelet_protect_kernel_defaults: true
  392. # Set additional sysctl variables to modify Linux kernel variables, for example:
  393. # additional_sysctl:
  394. # - { name: kernel.pid_max, value: 131072 }
  395. #
  396. additional_sysctl: []
  397. ## List of key=value pairs that describe feature gates for
  398. ## the k8s cluster.
  399. kube_feature_gates: []
  400. kube_apiserver_feature_gates: []
  401. kube_controller_feature_gates: []
  402. kube_scheduler_feature_gates: []
  403. kube_proxy_feature_gates: []
  404. kubelet_feature_gates: []
  405. kubeadm_feature_gates: []
  406. # Local volume provisioner storage classes
  407. # Levarages Ansibles string to Python datatype casting. Otherwise the dict_key isn't substituted
  408. # see https://github.com/ansible/ansible/issues/17324
  409. local_volume_provisioner_storage_classes: |
  410. {
  411. "{{ local_volume_provisioner_storage_class | default('local-storage') }}": {
  412. "host_dir": "{{ local_volume_provisioner_base_dir | default('/mnt/disks') }}",
  413. "mount_dir": "{{ local_volume_provisioner_mount_dir | default('/mnt/disks') }}",
  414. "volume_mode": "Filesystem",
  415. "fs_type": "ext4"
  416. }
  417. }
  418. # weave's network password for encryption
  419. # if null then no network encryption
  420. # you can use --extra-vars to pass the password in command line
  421. weave_password: EnterPasswordHere
  422. ssl_ca_dirs: |-
  423. [
  424. {% if ansible_os_family in ['Flatcar', 'Flatcar Container Linux by Kinvolk'] -%}
  425. '/usr/share/ca-certificates',
  426. {% elif ansible_os_family == 'RedHat' -%}
  427. '/etc/pki/tls',
  428. '/etc/pki/ca-trust',
  429. {% elif ansible_os_family == 'Debian' -%}
  430. '/usr/share/ca-certificates',
  431. {% endif -%}
  432. ]
  433. # Vars for pointing to kubernetes api endpoints
  434. kube_apiserver_count: "{{ groups['kube_control_plane'] | length }}"
  435. kube_apiserver_address: "{{ ip | default(fallback_ips[inventory_hostname]) }}"
  436. kube_apiserver_access_address: "{{ access_ip | default(kube_apiserver_address) }}"
  437. first_kube_control_plane_address: "{{ hostvars[groups['kube_control_plane'][0]]['access_ip'] | default(hostvars[groups['kube_control_plane'][0]]['ip'] | default(fallback_ips[groups['kube_control_plane'][0]])) }}"
  438. loadbalancer_apiserver_localhost: "{{ loadbalancer_apiserver is not defined }}"
  439. loadbalancer_apiserver_type: "nginx"
  440. # applied if only external loadbalancer_apiserver is defined, otherwise ignored
  441. apiserver_loadbalancer_domain_name: "lb-apiserver.kubernetes.local"
  442. kube_apiserver_global_endpoint: |-
  443. {% if loadbalancer_apiserver is defined -%}
  444. https://{{ apiserver_loadbalancer_domain_name }}:{{ loadbalancer_apiserver.port | default(kube_apiserver_port) }}
  445. {%- elif loadbalancer_apiserver_localhost and (loadbalancer_apiserver_port is not defined or loadbalancer_apiserver_port == kube_apiserver_port) -%}
  446. https://localhost:{{ kube_apiserver_port }}
  447. {%- else -%}
  448. https://{{ first_kube_control_plane_address }}:{{ kube_apiserver_port }}
  449. {%- endif %}
  450. kube_apiserver_endpoint: |-
  451. {% if loadbalancer_apiserver is defined -%}
  452. https://{{ apiserver_loadbalancer_domain_name }}:{{ loadbalancer_apiserver.port | default(kube_apiserver_port) }}
  453. {%- elif ('kube_control_plane' not in group_names) and loadbalancer_apiserver_localhost -%}
  454. https://localhost:{{ loadbalancer_apiserver_port | default(kube_apiserver_port) }}
  455. {%- elif 'kube_control_plane' in group_names -%}
  456. https://{{ kube_apiserver_bind_address | regex_replace('0\.0\.0\.0', '127.0.0.1') }}:{{ kube_apiserver_port }}
  457. {%- else -%}
  458. https://{{ first_kube_control_plane_address }}:{{ kube_apiserver_port }}
  459. {%- endif %}
  460. kube_apiserver_client_cert: "{{ kube_cert_dir }}/ca.crt"
  461. kube_apiserver_client_key: "{{ kube_cert_dir }}/ca.key"
  462. # Set to true to deploy etcd-events cluster
  463. etcd_events_cluster_enabled: false
  464. # etcd group can be empty when kubeadm manages etcd
  465. etcd_hosts: "{{ groups['etcd'] | default(groups['kube_control_plane']) }}"
  466. # Vars for pointing to etcd endpoints
  467. etcd_address: "{{ ip | default(fallback_ips[inventory_hostname]) }}"
  468. etcd_access_address: "{{ access_ip | default(etcd_address) }}"
  469. etcd_events_access_address: "{{ access_ip | default(etcd_address) }}"
  470. etcd_peer_url: "https://{{ etcd_access_address }}:2380"
  471. etcd_client_url: "https://{{ etcd_access_address }}:2379"
  472. etcd_events_peer_url: "https://{{ etcd_events_access_address }}:2382"
  473. etcd_events_client_url: "https://{{ etcd_events_access_address }}:2383"
  474. etcd_access_addresses: |-
  475. {% for item in etcd_hosts -%}
  476. https://{{ hostvars[item]['etcd_access_address'] | default(hostvars[item]['ip'] | default(fallback_ips[item])) }}:2379{% if not loop.last %},{% endif %}
  477. {%- endfor %}
  478. etcd_events_access_addresses_list: |-
  479. [
  480. {% for item in etcd_hosts -%}
  481. 'https://{{ hostvars[item]['etcd_events_access_address'] | default(hostvars[item]['ip'] | default(fallback_ips[item])) }}:2383'{% if not loop.last %},{% endif %}
  482. {%- endfor %}
  483. ]
  484. etcd_metrics_addresses: |-
  485. {% for item in etcd_hosts -%}
  486. https://{{ hostvars[item]['etcd_access_address'] | default(hostvars[item]['ip'] | default(fallback_ips[item])) }}:{{ etcd_metrics_port | default(2381) }}{% if not loop.last %},{% endif %}
  487. {%- endfor %}
  488. etcd_events_access_addresses: "{{ etcd_events_access_addresses_list | join(',') }}"
  489. etcd_events_access_addresses_semicolon: "{{ etcd_events_access_addresses_list | join(';') }}"
  490. # user should set etcd_member_name in inventory/mycluster/hosts.ini
  491. etcd_member_name: |-
  492. {% for host in groups['etcd'] %}
  493. {% if inventory_hostname == host %}{{ hostvars[host].etcd_member_name | default("etcd" + loop.index | string) }}{% endif %}
  494. {% endfor %}
  495. etcd_peer_addresses: |-
  496. {% for item in groups['etcd'] -%}
  497. {{ hostvars[item].etcd_member_name | default("etcd" + loop.index | string) }}=https://{{ hostvars[item].etcd_access_address | default(hostvars[item].ip | default(fallback_ips[item])) }}:2380{% if not loop.last %},{% endif %}
  498. {%- endfor %}
  499. etcd_events_peer_addresses: |-
  500. {% for item in groups['etcd'] -%}
  501. {{ hostvars[item].etcd_member_name | default("etcd" + loop.index | string) }}-events=https://{{ hostvars[item].etcd_events_access_address | default(hostvars[item].ip | default(fallback_ips[item])) }}:2382{% if not loop.last %},{% endif %}
  502. {%- endfor %}
  503. etcd_heartbeat_interval: "250"
  504. etcd_election_timeout: "5000"
  505. etcd_snapshot_count: "10000"
  506. certificates_key_size: 2048
  507. certificates_duration: 36500
  508. etcd_config_dir: /etc/ssl/etcd
  509. etcd_events_data_dir: "/var/lib/etcd-events"
  510. etcd_cert_dir: "{{ etcd_config_dir }}/ssl"
  511. typha_enabled: false
  512. calico_apiserver_enabled: false
  513. _host_architecture_groups:
  514. x86_64: amd64
  515. aarch64: arm64
  516. armv7l: arm
  517. host_architecture: >-
  518. {%- if ansible_architecture in _host_architecture_groups -%}
  519. {{ _host_architecture_groups[ansible_architecture] }}
  520. {%- else -%}
  521. {{ ansible_architecture }}
  522. {%- endif -%}
  523. _host_os_groups:
  524. Linux: linux
  525. Darwin: darwin
  526. Win32NT: windows
  527. host_os: >-
  528. {%- if ansible_system in _host_os_groups -%}
  529. {{ _host_os_groups[ansible_system] }}
  530. {%- else -%}
  531. {{ ansible_system }}
  532. {%- endif -%}
  533. # Sets the eventRecordQPS parameter in kubelet-config.yaml.
  534. # Setting it to 0 allows unlimited requests per second.
  535. kubelet_event_record_qps: 50
  536. proxy_env_defaults:
  537. http_proxy: "{{ http_proxy | default('') }}"
  538. HTTP_PROXY: "{{ http_proxy | default('') }}"
  539. https_proxy: "{{ https_proxy | default('') }}"
  540. HTTPS_PROXY: "{{ https_proxy | default('') }}"
  541. no_proxy: "{{ no_proxy | default('') }}"
  542. NO_PROXY: "{{ no_proxy | default('') }}"
  543. # If we use SSL_CERT_FILE: {{ omit }} it cause in value __omit_place_holder__ and break environments
  544. # Combine dict is avoiding the problem with omit placeholder. Maybe it can be better solution?
  545. proxy_env: "{{ proxy_env_defaults | combine({'SSL_CERT_FILE': https_proxy_cert_file}) if https_proxy_cert_file is defined else proxy_env_defaults }}"
  546. proxy_disable_env:
  547. ALL_PROXY: ''
  548. FTP_PROXY: ''
  549. HTTPS_PROXY: ''
  550. HTTP_PROXY: ''
  551. NO_PROXY: ''
  552. all_proxy: ''
  553. ftp_proxy: ''
  554. http_proxy: ''
  555. https_proxy: ''
  556. no_proxy: ''
  557. # krew root dir
  558. krew_root_dir: "/usr/local/krew"
  559. # sysctl_file_path to add sysctl conf to
  560. sysctl_file_path: "/etc/sysctl.d/99-sysctl.conf"
  561. system_upgrade: false
  562. system_upgrade_reboot: on-upgrade # never, always
  563. # Enables or disables the scheduler plugins.
  564. scheduler_plugins_enabled: false