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.

235 lines
9.3 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.15.2
  19. # kubernetes image repo define
  20. kube_image_repo: "gcr.io/google-containers"
  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. # A string slice of values which specify the addresses to use for NodePorts.
  81. # Values may be valid IP blocks (e.g. 1.2.3.0/24, 1.2.3.4/32).
  82. # The default empty string slice ([]) means to use all local addresses.
  83. # kube_proxy_nodeport_addresses_cidr is retained for legacy config
  84. kube_proxy_nodeport_addresses: >-
  85. {%- if kube_proxy_nodeport_addresses_cidr is defined -%}
  86. [{{ kube_proxy_nodeport_addresses_cidr }}]
  87. {%- else -%}
  88. []
  89. {%- endif -%}
  90. # If non-empty, will use this string as identification instead of the actual hostname
  91. # kube_override_hostname: >-
  92. # {%- if cloud_provider is defined and cloud_provider in [ 'aws' ] -%}
  93. # {%- else -%}
  94. # {{ inventory_hostname }}
  95. # {%- endif -%}
  96. ## Encrypting Secret Data at Rest (experimental)
  97. kube_encrypt_secret_data: false
  98. # DNS configuration.
  99. # Kubernetes cluster name, also will be used as DNS domain
  100. cluster_name: cluster.local
  101. # Subdomains of DNS domain to be resolved via /etc/resolv.conf for hostnet pods
  102. ndots: 2
  103. # Can be coredns, coredns_dual, manual or none
  104. dns_mode: coredns
  105. # Set manual server if using a custom cluster DNS server
  106. # manual_dns_server: 10.x.x.x
  107. # Enable nodelocal dns cache
  108. enable_nodelocaldns: true
  109. nodelocaldns_ip: 169.254.25.10
  110. nodelocaldns_health_port: 9254
  111. # Enable k8s_external plugin for CoreDNS
  112. enable_coredns_k8s_external: false
  113. coredns_k8s_external_zone: k8s_external.local
  114. # Enable endpoint_pod_names option for kubernetes plugin
  115. enable_coredns_k8s_endpoint_pod_names: false
  116. # Can be docker_dns, host_resolvconf or none
  117. resolvconf_mode: docker_dns
  118. # Deploy netchecker app to verify DNS resolve as an HTTP service
  119. deploy_netchecker: false
  120. # Ip address of the kubernetes skydns service
  121. skydns_server: "{{ kube_service_addresses|ipaddr('net')|ipaddr(3)|ipaddr('address') }}"
  122. skydns_server_secondary: "{{ kube_service_addresses|ipaddr('net')|ipaddr(4)|ipaddr('address') }}"
  123. dns_domain: "{{ cluster_name }}"
  124. ## Container runtime
  125. ## docker for docker, crio for cri-o and containerd for containerd.
  126. container_manager: docker
  127. ## Settings for containerized control plane (etcd/kubelet/secrets)
  128. etcd_deployment_type: docker
  129. kubelet_deployment_type: host
  130. helm_deployment_type: host
  131. # Enable kubeadm experimental control plane
  132. kubeadm_control_plane: false
  133. kubeadm_certificate_key: "{{ lookup('password', credentials_dir + '/kubeadm_certificate_key.creds length=64 chars=hexdigits') | lower }}"
  134. # K8s image pull policy (imagePullPolicy)
  135. k8s_image_pull_policy: IfNotPresent
  136. # audit log for kubernetes
  137. kubernetes_audit: false
  138. # dynamic kubelet configuration
  139. dynamic_kubelet_configuration: false
  140. # define kubelet config dir for dynamic kubelet
  141. # kubelet_config_dir:
  142. default_kubelet_config_dir: "{{ kube_config_dir }}/dynamic_kubelet_dir"
  143. dynamic_kubelet_configuration_dir: "{{ kubelet_config_dir | default(default_kubelet_config_dir) }}"
  144. # pod security policy (RBAC must be enabled either by having 'RBAC' in authorization_modes or kubeadm enabled)
  145. podsecuritypolicy_enabled: false
  146. # Make a copy of kubeconfig on the host that runs Ansible in {{ inventory_dir }}/artifacts
  147. # kubeconfig_localhost: false
  148. # Download kubectl onto the host that runs Ansible in {{ bin_dir }}
  149. # kubectl_localhost: false
  150. # Enable creation of QoS cgroup hierarchy, if true top level QoS and pod cgroups are created. (default true)
  151. # kubelet_cgroups_per_qos: true
  152. # A comma separated list of levels of node allocatable enforcement to be enforced by kubelet.
  153. # Acceptable options are 'pods', 'system-reserved', 'kube-reserved' and ''. Default is "".
  154. # kubelet_enforce_node_allocatable: pods
  155. ## Optionally reserve resources for OS system daemons.
  156. # system_reserved: true
  157. ## Uncomment to override default values
  158. # system_memory_reserved: 512M
  159. # system_cpu_reserved: 500m
  160. ## Reservation for master hosts
  161. # system_master_memory_reserved: 256M
  162. # system_master_cpu_reserved: 250m
  163. # An alternative flexvolume plugin directory
  164. # kubelet_flexvolumes_plugins_dir: /usr/libexec/kubernetes/kubelet-plugins/volume/exec
  165. ## Supplementary addresses that can be added in kubernetes ssl keys.
  166. ## That can be useful for example to setup a keepalived virtual IP
  167. # supplementary_addresses_in_ssl_keys: [10.0.0.1, 10.0.0.2, 10.0.0.3]
  168. ## Running on top of openstack vms with cinder enabled may lead to unschedulable pods due to NoVolumeZoneConflict restriction in kube-scheduler.
  169. ## See https://github.com/kubernetes-sigs/kubespray/issues/2141
  170. ## Set this variable to true to get rid of this issue
  171. volume_cross_zone_attachment: false
  172. # Add Persistent Volumes Storage Class for corresponding cloud provider ( OpenStack is only supported now )
  173. persistent_volumes_enabled: false
  174. ## Container Engine Acceleration
  175. ## Enable container acceleration feature, for example use gpu acceleration in containers
  176. # nvidia_accelerator_enabled: true
  177. ## Nvidia GPU driver install. Install will by done by a (init) pod running as a daemonset.
  178. ## Important: if you use Ubuntu then you should set in all.yml 'docker_storage_options: -s overlay2'
  179. ## Array with nvida_gpu_nodes, leave empty or comment if you dont't want to install drivers.
  180. ## Labels and taints won't be set to nodes if they are not in the array.
  181. # nvidia_gpu_nodes:
  182. # - kube-gpu-001
  183. # nvidia_driver_version: "384.111"
  184. ## flavor can be tesla or gtx
  185. # nvidia_gpu_flavor: gtx
  186. ## NVIDIA driver installer images. Change them if you have trouble accessing gcr.io.
  187. # nvidia_driver_install_centos_container: atzedevries/nvidia-centos-driver-installer:2
  188. # nvidia_driver_install_ubuntu_container: gcr.io/google-containers/ubuntu-nvidia-driver-installer@sha256:7df76a0f0a17294e86f691c81de6bbb7c04a1b4b3d4ea4e7e2cccdc42e1f6d63
  189. ## NVIDIA GPU device plugin image.
  190. # nvidia_gpu_device_plugin_container: "k8s.gcr.io/nvidia-gpu-device-plugin@sha256:0842734032018be107fa2490c98156992911e3e1f2a21e059ff0105b07dd8e9e"