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.

52 lines
2.5 KiB

  1. ###
  2. # kubernetes system config
  3. #
  4. # The following values are used to configure the kube-apiserver
  5. {% if ansible_service_mgr in ["sysvinit","upstart"] %}
  6. # Logging directory
  7. KUBE_LOGGING="--log-dir={{ kube_log_dir }} --logtostderr=true"
  8. {% else %}
  9. # logging to stderr means we get it in the systemd journal
  10. KUBE_LOGGING="--logtostderr=true"
  11. {% endif %}
  12. # Apiserver Log level, 0 is debug
  13. KUBE_LOG_LEVEL="{{ kube_log_level | default('--v=2') }}"
  14. # Should this cluster be allowed to run privileged docker containers
  15. KUBE_ALLOW_PRIV="--allow_privileged=true"
  16. # The port on the local server to listen on.
  17. KUBE_API_PORT="--insecure-port={{kube_apiserver_insecure_port}} --secure-port={{ kube_apiserver_port }}"
  18. # Address range to use for services
  19. KUBE_SERVICE_ADDRESSES="--service-cluster-ip-range={{ kube_service_addresses }}"
  20. # Location of the etcd cluster
  21. KUBE_ETCD_SERVERS="--etcd_servers={% for host in groups['etcd'] %}http://{{ hostvars[host]['access_ip'] | default(hostvars[host]['ip'] | default(hostvars[host]['ansible_default_ipv4']['address'])) }}:2379{% if not loop.last %},{% endif %}{% endfor %}"
  22. # default admission control policies
  23. KUBE_ADMISSION_CONTROL="--admission_control=NamespaceLifecycle,NamespaceExists,LimitRanger,SecurityContextDeny,ServiceAccount,ResourceQuota"
  24. # RUNTIME API CONFIGURATION (e.g. enable extensions)
  25. KUBE_RUNTIME_CONFIG="{% if kube_api_runtime_config is defined %}{% for conf in kube_api_runtime_config %}--runtime-config={{ conf }} {% endfor %}{% endif %}"
  26. # TLS CONFIGURATION
  27. KUBE_TLS_CONFIG="--tls_cert_file={{ kube_cert_dir }}/apiserver.pem --tls_private_key_file={{ kube_cert_dir }}/apiserver-key.pem --client_ca_file={{ kube_cert_dir }}/ca.pem"
  28. # Add you own!
  29. KUBE_API_ARGS="--token_auth_file={{ kube_token_dir }}/known_tokens.csv --basic-auth-file={{ kube_users_dir }}/known_users.csv --service_account_key_file={{ kube_cert_dir }}/apiserver-key.pem --advertise-address={{ ip | default(ansible_default_ipv4.address) }}"
  30. {% if cloud_provider is defined and cloud_provider == "openstack" %}
  31. KUBELET_CLOUDPROVIDER="--cloud-provider={{ cloud_provider }} --cloud-config={{ kube_config_dir }}/cloud_config"
  32. {% else %}
  33. {# TODO: gce and aws don't need the cloud provider to be set? #}
  34. KUBELET_CLOUDPROVIDER=""
  35. {% endif %}
  36. {% if ansible_service_mgr in ["sysvinit","upstart"] %}
  37. DAEMON_ARGS="$KUBE_LOGGING $KUBE_LOG_LEVEL $KUBE_ALLOW_PRIV $KUBE_API_PORT $KUBE_SERVICE_ADDRESSES \
  38. $KUBE_ETCD_SERVERS $KUBE_ADMISSION_CONTROL $KUBE_RUNTIME_CONFIG $KUBE_TLS_CONFIG $KUBE_API_ARGS \
  39. $KUBELET_CLOUDPROVIDER"
  40. {% endif %}