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.

390 lines
16 KiB

6 years ago
6 years ago
  1. ---
  2. # Kubernetes configuration dirs and system namespace.
  3. # Those are where all the additional config stuff goes
  4. # the kubernetes normally puts in /srv/kubernetes.
  5. # This puts them in a sane location and namespace.
  6. # Editing those values will almost surely break something.
  7. kube_config_dir: /etc/kubernetes
  8. kube_script_dir: "{{ bin_dir }}/kubernetes-scripts"
  9. kube_manifest_dir: "{{ kube_config_dir }}/manifests"
  10. # This is where all the cert scripts and certs will be located
  11. kube_cert_dir: "{{ kube_config_dir }}/ssl"
  12. # This is where all of the bearer tokens will be stored
  13. kube_token_dir: "{{ kube_config_dir }}/tokens"
  14. kube_api_anonymous_auth: true
  15. ## Change this to use another Kubernetes version, e.g. a current beta release
  16. kube_version: v1.30.4
  17. # Where the binaries will be downloaded.
  18. # Note: ensure that you've enough disk space (about 1G)
  19. local_release_dir: "/tmp/releases"
  20. # Random shifts for retrying failed ops like pushing/downloading
  21. retry_stagger: 5
  22. # This is the user that owns tha cluster installation.
  23. kube_owner: kube
  24. # This is the group that the cert creation scripts chgrp the
  25. # cert files to. Not really changeable...
  26. kube_cert_group: kube-cert
  27. # Cluster Loglevel configuration
  28. kube_log_level: 2
  29. # Directory where credentials will be stored
  30. credentials_dir: "{{ inventory_dir }}/credentials"
  31. ## It is possible to activate / deactivate selected authentication methods (oidc, static token auth)
  32. # kube_oidc_auth: false
  33. # kube_token_auth: false
  34. ## Variables for OpenID Connect Configuration https://kubernetes.io/docs/admin/authentication/
  35. ## To use OpenID you have to deploy additional an OpenID Provider (e.g Dex, Keycloak, ...)
  36. # kube_oidc_url: https:// ...
  37. # kube_oidc_client_id: kubernetes
  38. ## Optional settings for OIDC
  39. # kube_oidc_ca_file: "{{ kube_cert_dir }}/ca.pem"
  40. # kube_oidc_username_claim: sub
  41. # kube_oidc_username_prefix: 'oidc:'
  42. # kube_oidc_groups_claim: groups
  43. # kube_oidc_groups_prefix: 'oidc:'
  44. ## Variables to control webhook authn/authz
  45. # kube_webhook_token_auth: false
  46. # kube_webhook_token_auth_url: https://...
  47. # kube_webhook_token_auth_url_skip_tls_verify: false
  48. ## For webhook authorization, authorization_modes must include Webhook
  49. # kube_webhook_authorization: false
  50. # kube_webhook_authorization_url: https://...
  51. # kube_webhook_authorization_url_skip_tls_verify: false
  52. # Choose network plugin (cilium, calico, kube-ovn, weave or flannel. Use cni for generic cni plugin)
  53. # Can also be set to 'cloud', which lets the cloud provider setup appropriate routing
  54. kube_network_plugin: calico
  55. # Setting multi_networking to true will install Multus: https://github.com/k8snetworkplumbingwg/multus-cni
  56. kube_network_plugin_multus: false
  57. # Kubernetes internal network for services, unused block of space.
  58. kube_service_addresses: 10.233.0.0/18
  59. # internal network. When used, it will assign IP
  60. # addresses from this range to individual pods.
  61. # This network must be unused in your network infrastructure!
  62. kube_pods_subnet: 10.233.64.0/18
  63. # internal network node size allocation (optional). This is the size allocated
  64. # to each node for pod IP address allocation. Note that the number of pods per node is
  65. # also limited by the kubelet_max_pods variable which defaults to 110.
  66. #
  67. # Example:
  68. # Up to 64 nodes and up to 254 or kubelet_max_pods (the lowest of the two) pods per node:
  69. # - kube_pods_subnet: 10.233.64.0/18
  70. # - kube_network_node_prefix: 24
  71. # - kubelet_max_pods: 110
  72. #
  73. # Example:
  74. # Up to 128 nodes and up to 126 or kubelet_max_pods (the lowest of the two) pods per node:
  75. # - kube_pods_subnet: 10.233.64.0/18
  76. # - kube_network_node_prefix: 25
  77. # - kubelet_max_pods: 110
  78. kube_network_node_prefix: 24
  79. # Configure Dual Stack networking (i.e. both IPv4 and IPv6)
  80. enable_dual_stack_networks: false
  81. # Kubernetes internal network for IPv6 services, unused block of space.
  82. # This is only used if enable_dual_stack_networks is set to true
  83. # This provides 4096 IPv6 IPs
  84. kube_service_addresses_ipv6: fd85:ee78:d8a6:8607::1000/116
  85. # Internal network. When used, it will assign IPv6 addresses from this range to individual pods.
  86. # This network must not already be in your network infrastructure!
  87. # This is only used if enable_dual_stack_networks is set to true.
  88. # This provides room for 256 nodes with 254 pods per node.
  89. kube_pods_subnet_ipv6: fd85:ee78:d8a6:8607::1:0000/112
  90. # IPv6 subnet size allocated to each for pods.
  91. # This is only used if enable_dual_stack_networks is set to true
  92. # This provides room for 254 pods per node.
  93. kube_network_node_prefix_ipv6: 120
  94. # The port the API Server will be listening on.
  95. kube_apiserver_ip: "{{ kube_service_addresses | ansible.utils.ipaddr('net') | ansible.utils.ipaddr(1) | ansible.utils.ipaddr('address') }}"
  96. kube_apiserver_port: 6443 # (https)
  97. # Kube-proxy proxyMode configuration.
  98. # Can be ipvs, iptables
  99. kube_proxy_mode: ipvs
  100. # configure arp_ignore and arp_announce to avoid answering ARP queries from kube-ipvs0 interface
  101. # must be set to true for MetalLB, kube-vip(ARP enabled) to work
  102. kube_proxy_strict_arp: false
  103. # A string slice of values which specify the addresses to use for NodePorts.
  104. # Values may be valid IP blocks (e.g. 1.2.3.0/24, 1.2.3.4/32).
  105. # The default empty string slice ([]) means to use all local addresses.
  106. # kube_proxy_nodeport_addresses_cidr is retained for legacy config
  107. kube_proxy_nodeport_addresses: >-
  108. {%- if kube_proxy_nodeport_addresses_cidr is defined -%}
  109. [{{ kube_proxy_nodeport_addresses_cidr }}]
  110. {%- else -%}
  111. []
  112. {%- endif -%}
  113. # If non-empty, will use this string as identification instead of the actual hostname
  114. # kube_override_hostname: >-
  115. # {%- if cloud_provider is defined and cloud_provider in ['aws'] -%}
  116. # {%- else -%}
  117. # {{ inventory_hostname }}
  118. # {%- endif -%}
  119. ## Encrypting Secret Data at Rest
  120. kube_encrypt_secret_data: false
  121. # Graceful Node Shutdown (Kubernetes >= 1.21.0), see https://kubernetes.io/blog/2021/04/21/graceful-node-shutdown-beta/
  122. # kubelet_shutdown_grace_period had to be greater than kubelet_shutdown_grace_period_critical_pods to allow
  123. # non-critical podsa to also terminate gracefully
  124. # kubelet_shutdown_grace_period: 60s
  125. # kubelet_shutdown_grace_period_critical_pods: 20s
  126. # DNS configuration.
  127. # Kubernetes cluster name, also will be used as DNS domain
  128. cluster_name: cluster.local
  129. # Subdomains of DNS domain to be resolved via /etc/resolv.conf for hostnet pods
  130. ndots: 2
  131. # dns_timeout: 2
  132. # dns_attempts: 2
  133. # Custom search domains to be added in addition to the default cluster search domains
  134. # searchdomains:
  135. # - svc.{{ cluster_name }}
  136. # - default.svc.{{ cluster_name }}
  137. # Remove default cluster search domains (``default.svc.{{ dns_domain }}, svc.{{ dns_domain }}``).
  138. # remove_default_searchdomains: false
  139. # Can be coredns, coredns_dual, manual or none
  140. dns_mode: coredns
  141. # Set manual server if using a custom cluster DNS server
  142. # manual_dns_server: 10.x.x.x
  143. # Enable nodelocal dns cache
  144. enable_nodelocaldns: true
  145. enable_nodelocaldns_secondary: false
  146. nodelocaldns_ip: 169.254.25.10
  147. nodelocaldns_health_port: 9254
  148. nodelocaldns_second_health_port: 9256
  149. nodelocaldns_bind_metrics_host_ip: false
  150. nodelocaldns_secondary_skew_seconds: 5
  151. # nodelocaldns_external_zones:
  152. # - zones:
  153. # - example.com
  154. # - example.io:1053
  155. # nameservers:
  156. # - 1.1.1.1
  157. # - 2.2.2.2
  158. # cache: 5
  159. # - zones:
  160. # - https://mycompany.local:4453
  161. # nameservers:
  162. # - 192.168.0.53
  163. # cache: 0
  164. # - zones:
  165. # - mydomain.tld
  166. # nameservers:
  167. # - 10.233.0.3
  168. # cache: 5
  169. # rewrite:
  170. # - name website.tld website.namespace.svc.cluster.local
  171. # Enable k8s_external plugin for CoreDNS
  172. enable_coredns_k8s_external: false
  173. coredns_k8s_external_zone: k8s_external.local
  174. # Enable endpoint_pod_names option for kubernetes plugin
  175. enable_coredns_k8s_endpoint_pod_names: false
  176. # Set forward options for upstream DNS servers in coredns (and nodelocaldns) config
  177. # dns_upstream_forward_extra_opts:
  178. # policy: sequential
  179. # Apply extra options to coredns kubernetes plugin
  180. # coredns_kubernetes_extra_opts:
  181. # - 'fallthrough example.local'
  182. # Forward extra domains to the coredns kubernetes plugin
  183. # coredns_kubernetes_extra_domains: ''
  184. # Can be docker_dns, host_resolvconf or none
  185. resolvconf_mode: host_resolvconf
  186. # Deploy netchecker app to verify DNS resolve as an HTTP service
  187. deploy_netchecker: false
  188. # Ip address of the kubernetes skydns service
  189. skydns_server: "{{ kube_service_addresses | ansible.utils.ipaddr('net') | ansible.utils.ipaddr(3) | ansible.utils.ipaddr('address') }}"
  190. skydns_server_secondary: "{{ kube_service_addresses | ansible.utils.ipaddr('net') | ansible.utils.ipaddr(4) | ansible.utils.ipaddr('address') }}"
  191. dns_domain: "{{ cluster_name }}"
  192. ## Container runtime
  193. ## docker for docker, crio for cri-o and containerd for containerd.
  194. ## Default: containerd
  195. container_manager: containerd
  196. # Additional container runtimes
  197. kata_containers_enabled: false
  198. kubeadm_certificate_key: "{{ lookup('password', credentials_dir + '/kubeadm_certificate_key.creds length=64 chars=hexdigits') | lower }}"
  199. # K8s image pull policy (imagePullPolicy)
  200. k8s_image_pull_policy: IfNotPresent
  201. # audit log for kubernetes
  202. kubernetes_audit: false
  203. # define kubelet config dir for dynamic kubelet
  204. # kubelet_config_dir:
  205. default_kubelet_config_dir: "{{ kube_config_dir }}/dynamic_kubelet_dir"
  206. # Make a copy of kubeconfig on the host that runs Ansible in {{ inventory_dir }}/artifacts
  207. # kubeconfig_localhost: false
  208. # Use ansible_host as external api ip when copying over kubeconfig.
  209. # kubeconfig_localhost_ansible_host: false
  210. # Download kubectl onto the host that runs Ansible in {{ bin_dir }}
  211. # kubectl_localhost: false
  212. # A comma separated list of levels of node allocatable enforcement to be enforced by kubelet.
  213. # Acceptable options are 'pods', 'system-reserved', 'kube-reserved' and ''. Default is "".
  214. # kubelet_enforce_node_allocatable: pods
  215. ## Set runtime and kubelet cgroups when using systemd as cgroup driver (default)
  216. # kubelet_runtime_cgroups: "/{{ kube_service_cgroups }}/{{ container_manager }}.service"
  217. # kubelet_kubelet_cgroups: "/{{ kube_service_cgroups }}/kubelet.service"
  218. ## Set runtime and kubelet cgroups when using cgroupfs as cgroup driver
  219. # kubelet_runtime_cgroups_cgroupfs: "/system.slice/{{ container_manager }}.service"
  220. # kubelet_kubelet_cgroups_cgroupfs: "/system.slice/kubelet.service"
  221. # Whether to run kubelet and container-engine daemons in a dedicated cgroup.
  222. # kube_reserved: false
  223. ## Uncomment to override default values
  224. ## The following two items need to be set when kube_reserved is true
  225. # kube_reserved_cgroups_for_service_slice: kube.slice
  226. # kube_reserved_cgroups: "/{{ kube_reserved_cgroups_for_service_slice }}"
  227. # kube_memory_reserved: 256Mi
  228. # kube_cpu_reserved: 100m
  229. # kube_ephemeral_storage_reserved: 2Gi
  230. # kube_pid_reserved: "1000"
  231. # Reservation for control plane hosts
  232. # kube_master_memory_reserved: 512Mi
  233. # kube_master_cpu_reserved: 200m
  234. # kube_master_ephemeral_storage_reserved: 2Gi
  235. # kube_master_pid_reserved: "1000"
  236. ## Optionally reserve resources for OS system daemons.
  237. # system_reserved: true
  238. ## Uncomment to override default values
  239. ## The following two items need to be set when system_reserved is true
  240. # system_reserved_cgroups_for_service_slice: system.slice
  241. # system_reserved_cgroups: "/{{ system_reserved_cgroups_for_service_slice }}"
  242. # system_memory_reserved: 512Mi
  243. # system_cpu_reserved: 500m
  244. # system_ephemeral_storage_reserved: 2Gi
  245. ## Reservation for master hosts
  246. # system_master_memory_reserved: 256Mi
  247. # system_master_cpu_reserved: 250m
  248. # system_master_ephemeral_storage_reserved: 2Gi
  249. ## Eviction Thresholds to avoid system OOMs
  250. # https://kubernetes.io/docs/tasks/administer-cluster/reserve-compute-resources/#eviction-thresholds
  251. # eviction_hard: {}
  252. # eviction_hard_control_plane: {}
  253. # An alternative flexvolume plugin directory
  254. # kubelet_flexvolumes_plugins_dir: /usr/libexec/kubernetes/kubelet-plugins/volume/exec
  255. ## Supplementary addresses that can be added in kubernetes ssl keys.
  256. ## That can be useful for example to setup a keepalived virtual IP
  257. # supplementary_addresses_in_ssl_keys: [10.0.0.1, 10.0.0.2, 10.0.0.3]
  258. ## Running on top of openstack vms with cinder enabled may lead to unschedulable pods due to NoVolumeZoneConflict restriction in kube-scheduler.
  259. ## See https://github.com/kubernetes-sigs/kubespray/issues/2141
  260. ## Set this variable to true to get rid of this issue
  261. volume_cross_zone_attachment: false
  262. ## Add Persistent Volumes Storage Class for corresponding cloud provider (supported: in-tree OpenStack, Cinder CSI,
  263. ## AWS EBS CSI, Azure Disk CSI, GCP Persistent Disk CSI)
  264. persistent_volumes_enabled: false
  265. ## Container Engine Acceleration
  266. ## Enable container acceleration feature, for example use gpu acceleration in containers
  267. # nvidia_accelerator_enabled: true
  268. ## Nvidia GPU driver install. Install will by done by a (init) pod running as a daemonset.
  269. ## Important: if you use Ubuntu then you should set in all.yml 'docker_storage_options: -s overlay2'
  270. ## Array with nvida_gpu_nodes, leave empty or comment if you don't want to install drivers.
  271. ## Labels and taints won't be set to nodes if they are not in the array.
  272. # nvidia_gpu_nodes:
  273. # - kube-gpu-001
  274. # nvidia_driver_version: "384.111"
  275. ## flavor can be tesla or gtx
  276. # nvidia_gpu_flavor: gtx
  277. ## NVIDIA driver installer images. Change them if you have trouble accessing gcr.io.
  278. # nvidia_driver_install_centos_container: atzedevries/nvidia-centos-driver-installer:2
  279. # nvidia_driver_install_ubuntu_container: gcr.io/google-containers/ubuntu-nvidia-driver-installer@sha256:7df76a0f0a17294e86f691c81de6bbb7c04a1b4b3d4ea4e7e2cccdc42e1f6d63
  280. ## NVIDIA GPU device plugin image.
  281. # nvidia_gpu_device_plugin_container: "registry.k8s.io/nvidia-gpu-device-plugin@sha256:0842734032018be107fa2490c98156992911e3e1f2a21e059ff0105b07dd8e9e"
  282. ## Support tls min version, Possible values: VersionTLS10, VersionTLS11, VersionTLS12, VersionTLS13.
  283. # tls_min_version: ""
  284. ## Support tls cipher suites.
  285. # tls_cipher_suites: {}
  286. # - TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA
  287. # - TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256
  288. # - TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
  289. # - TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
  290. # - TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
  291. # - TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256
  292. # - TLS_ECDHE_ECDSA_WITH_RC4_128_SHA
  293. # - TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
  294. # - TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
  295. # - TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
  296. # - TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
  297. # - TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
  298. # - TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
  299. # - TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256
  300. # - TLS_ECDHE_RSA_WITH_RC4_128_SHA
  301. # - TLS_RSA_WITH_3DES_EDE_CBC_SHA
  302. # - TLS_RSA_WITH_AES_128_CBC_SHA
  303. # - TLS_RSA_WITH_AES_128_CBC_SHA256
  304. # - TLS_RSA_WITH_AES_128_GCM_SHA256
  305. # - TLS_RSA_WITH_AES_256_CBC_SHA
  306. # - TLS_RSA_WITH_AES_256_GCM_SHA384
  307. # - TLS_RSA_WITH_RC4_128_SHA
  308. ## Amount of time to retain events. (default 1h0m0s)
  309. event_ttl_duration: "1h0m0s"
  310. ## Automatically renew K8S control plane certificates on first Monday of each month
  311. auto_renew_certificates: false
  312. # First Monday of each month
  313. # auto_renew_certificates_systemd_calendar: "Mon *-*-1,2,3,4,5,6,7 03:{{ groups['kube_control_plane'].index(inventory_hostname) }}0:00"
  314. kubeadm_patches_dir: "{{ kube_config_dir }}/patches"
  315. kubeadm_patches: []
  316. # See https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/control-plane-flags/#patches
  317. # Correspondance with this link
  318. # patchtype = type
  319. # target = target
  320. # suffix -> managed automatically
  321. # extension -> always "yaml"
  322. # kubeadm_patches:
  323. # - target: kube-apiserver|kube-controller-manager|kube-scheduler|etcd|kubeletconfiguration
  324. # type: strategic(default)|json|merge
  325. # patch:
  326. # metadata:
  327. # annotations:
  328. # example.com/test: "true"
  329. # labels:
  330. # example.com/prod_level: "{{ prod_level }}"
  331. # - ...
  332. # Patches are applied in the order they are specified.
  333. # Set to true to remove the role binding to anonymous users created by kubeadm
  334. remove_anonymous_access: false