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.

280 lines
10 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. # This is where to save basic auth file
  15. kube_users_dir: "{{ kube_config_dir }}/users"
  16. kube_api_anonymous_auth: true
  17. ## Change this to use another Kubernetes version, e.g. a current beta release
  18. kube_version: v1.17.5
  19. # kubernetes image repo define
  20. kube_image_repo: "k8s.gcr.io"
  21. # Where the binaries will be downloaded.
  22. # Note: ensure that you've enough disk space (about 1G)
  23. local_release_dir: "/tmp/releases"
  24. # Random shifts for retrying failed ops like pushing/downloading
  25. retry_stagger: 5
  26. # This is the group that the cert creation scripts chgrp the
  27. # cert files to. Not really changeable...
  28. kube_cert_group: kube-cert
  29. # Cluster Loglevel configuration
  30. kube_log_level: 2
  31. # Directory where credentials will be stored
  32. credentials_dir: "{{ inventory_dir }}/credentials"
  33. # Users to create for basic auth in Kubernetes API via HTTP
  34. # Optionally add groups for user
  35. kube_api_pwd: "{{ lookup('password', credentials_dir + '/kube_user.creds length=15 chars=ascii_letters,digits') }}"
  36. kube_users:
  37. kube:
  38. pass: "{{kube_api_pwd}}"
  39. role: admin
  40. groups:
  41. - system:masters
  42. ## It is possible to activate / deactivate selected authentication methods (basic auth, static token auth)
  43. # kube_oidc_auth: false
  44. # kube_basic_auth: false
  45. # kube_token_auth: false
  46. ## Variables for OpenID Connect Configuration https://kubernetes.io/docs/admin/authentication/
  47. ## To use OpenID you have to deploy additional an OpenID Provider (e.g Dex, Keycloak, ...)
  48. # kube_oidc_url: https:// ...
  49. # kube_oidc_client_id: kubernetes
  50. ## Optional settings for OIDC
  51. # kube_oidc_ca_file: "{{ kube_cert_dir }}/ca.pem"
  52. # kube_oidc_username_claim: sub
  53. # kube_oidc_username_prefix: oidc:
  54. # kube_oidc_groups_claim: groups
  55. # kube_oidc_groups_prefix: oidc:
  56. # Choose network plugin (cilium, calico, contiv, weave or flannel. Use cni for generic cni plugin)
  57. # Can also be set to 'cloud', which lets the cloud provider setup appropriate routing
  58. kube_network_plugin: calico
  59. # Setting multi_networking to true will install Multus: https://github.com/intel/multus-cni
  60. kube_network_plugin_multus: false
  61. # Kubernetes internal network for services, unused block of space.
  62. kube_service_addresses: 10.233.0.0/18
  63. # internal network. When used, it will assign IP
  64. # addresses from this range to individual pods.
  65. # This network must be unused in your network infrastructure!
  66. kube_pods_subnet: 10.233.64.0/18
  67. # internal network node size allocation (optional). This is the size allocated
  68. # to each node on your network. With these defaults you should have
  69. # room for 4096 nodes with 254 pods per node.
  70. kube_network_node_prefix: 24
  71. # The port the API Server will be listening on.
  72. kube_apiserver_ip: "{{ kube_service_addresses|ipaddr('net')|ipaddr(1)|ipaddr('address') }}"
  73. kube_apiserver_port: 6443 # (https)
  74. # kube_apiserver_insecure_port: 8080 # (http)
  75. # Set to 0 to disable insecure port - Requires RBAC in authorization_modes and kube_api_anonymous_auth: true
  76. kube_apiserver_insecure_port: 0 # (disabled)
  77. # Kube-proxy proxyMode configuration.
  78. # Can be ipvs, iptables
  79. kube_proxy_mode: ipvs
  80. # configure arp_ignore and arp_announce to avoid answering ARP queries from kube-ipvs0 interface
  81. # must be set to true for MetalLB to work
  82. kube_proxy_strict_arp: false
  83. # A string slice of values which specify the addresses to use for NodePorts.
  84. # Values may be valid IP blocks (e.g. 1.2.3.0/24, 1.2.3.4/32).
  85. # The default empty string slice ([]) means to use all local addresses.
  86. # kube_proxy_nodeport_addresses_cidr is retained for legacy config
  87. kube_proxy_nodeport_addresses: >-
  88. {%- if kube_proxy_nodeport_addresses_cidr is defined -%}
  89. [{{ kube_proxy_nodeport_addresses_cidr }}]
  90. {%- else -%}
  91. []
  92. {%- endif -%}
  93. # If non-empty, will use this string as identification instead of the actual hostname
  94. # kube_override_hostname: >-
  95. # {%- if cloud_provider is defined and cloud_provider in [ 'aws' ] -%}
  96. # {%- else -%}
  97. # {{ inventory_hostname }}
  98. # {%- endif -%}
  99. ## Encrypting Secret Data at Rest (experimental)
  100. kube_encrypt_secret_data: false
  101. # DNS configuration.
  102. # Kubernetes cluster name, also will be used as DNS domain
  103. cluster_name: cluster.local
  104. # Subdomains of DNS domain to be resolved via /etc/resolv.conf for hostnet pods
  105. ndots: 2
  106. # Can be coredns, coredns_dual, manual or none
  107. dns_mode: coredns
  108. # Set manual server if using a custom cluster DNS server
  109. # manual_dns_server: 10.x.x.x
  110. # Enable nodelocal dns cache
  111. enable_nodelocaldns: true
  112. nodelocaldns_ip: 169.254.25.10
  113. nodelocaldns_health_port: 9254
  114. # nodelocaldns_external_zones:
  115. # - zones:
  116. # - example.com
  117. # - example.io:1053
  118. # nameservers:
  119. # - 1.1.1.1
  120. # - 2.2.2.2
  121. # cache: 5
  122. # - zones:
  123. # - https://mycompany.local:4453
  124. # nameservers:
  125. # - 192.168.0.53
  126. # cache: 0
  127. # Enable k8s_external plugin for CoreDNS
  128. enable_coredns_k8s_external: false
  129. coredns_k8s_external_zone: k8s_external.local
  130. # Enable endpoint_pod_names option for kubernetes plugin
  131. enable_coredns_k8s_endpoint_pod_names: false
  132. # Can be docker_dns, host_resolvconf or none
  133. resolvconf_mode: docker_dns
  134. # Deploy netchecker app to verify DNS resolve as an HTTP service
  135. deploy_netchecker: false
  136. # Ip address of the kubernetes skydns service
  137. skydns_server: "{{ kube_service_addresses|ipaddr('net')|ipaddr(3)|ipaddr('address') }}"
  138. skydns_server_secondary: "{{ kube_service_addresses|ipaddr('net')|ipaddr(4)|ipaddr('address') }}"
  139. dns_domain: "{{ cluster_name }}"
  140. ## Container runtime
  141. ## docker for docker, crio for cri-o and containerd for containerd.
  142. container_manager: docker
  143. ## Settings for containerd runtimes (only used when container_manager is set to containerd)
  144. #
  145. # Settings for default containerd runtime
  146. # containerd_default_runtime:
  147. # type: io.containerd.runtime.v1.linux
  148. # engine: ''
  149. # root: ''
  150. #
  151. # Settings for additional runtimes for containerd configuration
  152. # containerd_runtimes:
  153. # - name: ""
  154. # type: ""
  155. # engine: ""
  156. # root: ""
  157. # Example for Kata Containers as additional runtime:
  158. # containerd_runtimes:
  159. # - name: kata
  160. # type: io.containerd.kata.v2
  161. # engine: ""
  162. # root: ""
  163. #
  164. # Settings for untrusted containerd runtime
  165. # containerd_untrusted_runtime_type: ''
  166. # containerd_untrusted_runtime_engine: ''
  167. # containerd_untrusted_runtime_root: ''
  168. ## Settings for containerized control plane (kubelet/secrets)
  169. kubelet_deployment_type: host
  170. helm_deployment_type: host
  171. # Enable kubeadm experimental control plane
  172. kubeadm_control_plane: false
  173. kubeadm_certificate_key: "{{ lookup('password', credentials_dir + '/kubeadm_certificate_key.creds length=64 chars=hexdigits') | lower }}"
  174. # K8s image pull policy (imagePullPolicy)
  175. k8s_image_pull_policy: IfNotPresent
  176. # audit log for kubernetes
  177. kubernetes_audit: false
  178. # dynamic kubelet configuration
  179. dynamic_kubelet_configuration: false
  180. # define kubelet config dir for dynamic kubelet
  181. # kubelet_config_dir:
  182. default_kubelet_config_dir: "{{ kube_config_dir }}/dynamic_kubelet_dir"
  183. dynamic_kubelet_configuration_dir: "{{ kubelet_config_dir | default(default_kubelet_config_dir) }}"
  184. # pod security policy (RBAC must be enabled either by having 'RBAC' in authorization_modes or kubeadm enabled)
  185. podsecuritypolicy_enabled: false
  186. # Custom PodSecurityPolicySpec for restricted policy
  187. # podsecuritypolicy_restricted_spec: {}
  188. # Custom PodSecurityPolicySpec for privileged policy
  189. # podsecuritypolicy_privileged_spec: {}
  190. # Make a copy of kubeconfig on the host that runs Ansible in {{ inventory_dir }}/artifacts
  191. # kubeconfig_localhost: false
  192. # Download kubectl onto the host that runs Ansible in {{ bin_dir }}
  193. # kubectl_localhost: false
  194. # A comma separated list of levels of node allocatable enforcement to be enforced by kubelet.
  195. # Acceptable options are 'pods', 'system-reserved', 'kube-reserved' and ''. Default is "".
  196. # kubelet_enforce_node_allocatable: pods
  197. ## Optionally reserve resources for OS system daemons.
  198. # system_reserved: true
  199. ## Uncomment to override default values
  200. # system_memory_reserved: 512M
  201. # system_cpu_reserved: 500m
  202. ## Reservation for master hosts
  203. # system_master_memory_reserved: 256M
  204. # system_master_cpu_reserved: 250m
  205. # An alternative flexvolume plugin directory
  206. # kubelet_flexvolumes_plugins_dir: /usr/libexec/kubernetes/kubelet-plugins/volume/exec
  207. ## Supplementary addresses that can be added in kubernetes ssl keys.
  208. ## That can be useful for example to setup a keepalived virtual IP
  209. # supplementary_addresses_in_ssl_keys: [10.0.0.1, 10.0.0.2, 10.0.0.3]
  210. ## Running on top of openstack vms with cinder enabled may lead to unschedulable pods due to NoVolumeZoneConflict restriction in kube-scheduler.
  211. ## See https://github.com/kubernetes-sigs/kubespray/issues/2141
  212. ## Set this variable to true to get rid of this issue
  213. volume_cross_zone_attachment: false
  214. ## Add Persistent Volumes Storage Class for corresponding cloud provider (supported: in-tree OpenStack, Cinder CSI,
  215. ## AWS EBS CSI, Azure Disk CSI, GCP Persistent Disk CSI)
  216. persistent_volumes_enabled: false
  217. ## Container Engine Acceleration
  218. ## Enable container acceleration feature, for example use gpu acceleration in containers
  219. # nvidia_accelerator_enabled: true
  220. ## Nvidia GPU driver install. Install will by done by a (init) pod running as a daemonset.
  221. ## Important: if you use Ubuntu then you should set in all.yml 'docker_storage_options: -s overlay2'
  222. ## Array with nvida_gpu_nodes, leave empty or comment if you don't want to install drivers.
  223. ## Labels and taints won't be set to nodes if they are not in the array.
  224. # nvidia_gpu_nodes:
  225. # - kube-gpu-001
  226. # nvidia_driver_version: "384.111"
  227. ## flavor can be tesla or gtx
  228. # nvidia_gpu_flavor: gtx
  229. ## NVIDIA driver installer images. Change them if you have trouble accessing gcr.io.
  230. # nvidia_driver_install_centos_container: atzedevries/nvidia-centos-driver-installer:2
  231. # nvidia_driver_install_ubuntu_container: gcr.io/google-containers/ubuntu-nvidia-driver-installer@sha256:7df76a0f0a17294e86f691c81de6bbb7c04a1b4b3d4ea4e7e2cccdc42e1f6d63
  232. ## NVIDIA GPU device plugin image.
  233. # nvidia_gpu_device_plugin_container: "k8s.gcr.io/nvidia-gpu-device-plugin@sha256:0842734032018be107fa2490c98156992911e3e1f2a21e059ff0105b07dd8e9e"