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.

141 lines
7.0 KiB

  1. Configurable Parameters in Kubespray
  2. ================================
  3. #### Generic Ansible variables
  4. You can view facts gathered by Ansible automatically
  5. [here](http://docs.ansible.com/ansible/playbooks_variables.html#information-discovered-from-systems-facts).
  6. Some variables of note include:
  7. * *ansible_user*: user to connect to via SSH
  8. * *ansible_default_ipv4.address*: IP address Ansible automatically chooses.
  9. Generated based on the output from the command ``ip -4 route get 8.8.8.8``
  10. #### Common vars that are used in Kubespray
  11. * *calico_version* - Specify version of Calico to use
  12. * *calico_cni_version* - Specify version of Calico CNI plugin to use
  13. * *docker_version* - Specify version of Docker to used (should be quoted
  14. string)
  15. * *etcd_version* - Specify version of ETCD to use
  16. * *ipip* - Enables Calico ipip encapsulation by default
  17. * *hyperkube_image_repo* - Specify the Docker repository where Hyperkube
  18. resides
  19. * *hyperkube_image_tag* - Specify the Docker tag where Hyperkube resides
  20. * *kube_network_plugin* - Sets k8s network plugin (default Calico)
  21. * *kube_proxy_mode* - Changes k8s proxy mode to iptables mode
  22. * *kube_version* - Specify a given Kubernetes hyperkube version
  23. * *searchdomains* - Array of DNS domains to search when looking up hostnames
  24. * *nameservers* - Array of nameservers to use for DNS lookup
  25. * *preinstall_selinux_state* - Set selinux state, permitted values are permissive and disabled.
  26. #### Addressing variables
  27. * *ip* - IP to use for binding services (host var)
  28. * *access_ip* - IP for other hosts to use to connect to. Often required when
  29. deploying from a cloud, such as OpenStack or GCE and you have separate
  30. public/floating and private IPs.
  31. * *ansible_default_ipv4.address* - Not Kubespray-specific, but it is used if ip
  32. and access_ip are undefined
  33. * *loadbalancer_apiserver* - If defined, all hosts will connect to this
  34. address instead of localhost for kube-masters and kube-master[0] for
  35. kube-nodes. See more details in the
  36. [HA guide](https://github.com/kubernetes-incubator/kubespray/blob/master/docs/ha-mode.md).
  37. * *loadbalancer_apiserver_localhost* - makes all hosts to connect to
  38. the apiserver internally load balanced endpoint. Mutual exclusive to the
  39. `loadbalancer_apiserver`. See more details in the
  40. [HA guide](https://github.com/kubernetes-incubator/kubespray/blob/master/docs/ha-mode.md).
  41. #### Cluster variables
  42. Kubernetes needs some parameters in order to get deployed. These are the
  43. following default cluster paramters:
  44. * *cluster_name* - Name of cluster (default is cluster.local)
  45. * *domain_name* - Name of cluster DNS domain (default is cluster.local)
  46. * *kube_network_plugin* - Plugin to use for container networking
  47. * *kube_service_addresses* - Subnet for cluster IPs (default is
  48. 10.233.0.0/18). Must not overlap with kube_pods_subnet
  49. * *kube_pods_subnet* - Subnet for Pod IPs (default is 10.233.64.0/18). Must not
  50. overlap with kube_service_addresses.
  51. * *kube_network_node_prefix* - Subnet allocated per-node for pod IPs. Remainin
  52. bits in kube_pods_subnet dictates how many kube-nodes can be in cluster.
  53. * *dns_setup* - Enables dnsmasq
  54. * *dnsmasq_dns_server* - Cluster IP for dnsmasq (default is 10.233.0.2)
  55. * *skydns_server* - Cluster IP for KubeDNS (default is 10.233.0.3)
  56. * *cloud_provider* - Enable extra Kubelet option if operating inside GCE or
  57. OpenStack (default is unset)
  58. * *kube_hostpath_dynamic_provisioner* - Required for use of PetSets type in
  59. Kubernetes
  60. * *kube_feature_gates* - A list of key=value pairs that describe feature gates for
  61. alpha/experimental Kubernetes features. (defaults is `[]`)
  62. * *authorization_modes* - A list of [authorization mode](
  63. https://kubernetes.io/docs/admin/authorization/#using-flags-for-your-authorization-module)
  64. that the cluster should be configured for. Defaults to `['Node', 'RBAC']`
  65. (Node and RBAC authorizers).
  66. Note: `Node` and `RBAC` are enabled by default. Previously deployed clusters can be
  67. converted to RBAC mode. However, your apps which rely on Kubernetes API will
  68. require a service account and cluster role bindings. You can override this
  69. setting by setting authorization_modes to `[]`.
  70. Note, if cloud providers have any use of the ``10.233.0.0/16``, like instances'
  71. private addresses, make sure to pick another values for ``kube_service_addresses``
  72. and ``kube_pods_subnet``, for example from the ``172.18.0.0/16``.
  73. #### DNS variables
  74. By default, dnsmasq gets set up with 8.8.8.8 as an upstream DNS server and all
  75. other settings from your existing /etc/resolv.conf are lost. Set the following
  76. variables to match your requirements.
  77. * *upstream_dns_servers* - Array of upstream DNS servers configured on host in
  78. addition to Kubespray deployed DNS
  79. * *nameservers* - Array of DNS servers configured for use in dnsmasq
  80. * *searchdomains* - Array of up to 4 search domains
  81. * *skip_dnsmasq* - Don't set up dnsmasq (use only KubeDNS)
  82. For more information, see [DNS
  83. Stack](https://github.com/kubernetes-incubator/kubespray/blob/master/docs/dns-stack.md).
  84. #### Other service variables
  85. * *docker_options* - Commonly used to set
  86. ``--insecure-registry=myregistry.mydomain:5000``
  87. * *http_proxy/https_proxy/no_proxy* - Proxy variables for deploying behind a
  88. proxy. Note that no_proxy defaults to all internal cluster IPs and hostnames
  89. that correspond to each node.
  90. * *kubelet_deployment_type* - Controls which platform to deploy kubelet on.
  91. Available options are ``host``, ``rkt``, and ``docker``. ``docker`` mode
  92. is unlikely to work on newer releases. Starting with Kubernetes v1.7
  93. series, this now defaults to ``host``. Before v1.7, the default was Docker.
  94. This is because of cgroup [issues](https://github.com/kubernetes/kubernetes/issues/43704).
  95. * *kubelet_load_modules* - For some things, kubelet needs to load kernel modules. For example,
  96. dynamic kernel services are needed for mounting persistent volumes into containers. These may not be
  97. loaded by preinstall kubernetes processes. For example, ceph and rbd backed volumes. Set this variable to
  98. true to let kubelet load kernel modules.
  99. * *kubelet_cgroup_driver* - Allows manual override of the
  100. cgroup-driver option for Kubelet. By default autodetection is used
  101. to match Docker configuration.
  102. ##### Custom flags for Kube Components
  103. For all kube components, custom flags can be passed in. This allows for edge cases where users need changes to the default deployment that may not be applicable to all deployments. This can be done by providing a list of flags. Example:
  104. ```
  105. kubelet_custom_flags:
  106. - "--eviction-hard=memory.available<100Mi"
  107. - "--eviction-soft-grace-period=memory.available=30s"
  108. - "--eviction-soft=memory.available<300Mi"
  109. ```
  110. The possible vars are:
  111. * *apiserver_custom_flags*
  112. * *controller_mgr_custom_flags*
  113. * *scheduler_custom_flags*
  114. * *kubelet_custom_flags*
  115. #### User accounts
  116. By default, a user with admin rights is created, named `kube`.
  117. The password can be viewed after deployment by looking at the file
  118. `PATH_TO_KUBESPRAY/credentials/kube_user`. This contains a randomly generated
  119. password. If you wish to set your own password, just precreate/modify this
  120. file yourself or change `kube_api_pwd` var.