2016-01-22 21:25:33 +08:00
###
# kubernetes system config
#
# The following values are used to configure the kube-apiserver
2016-02-13 18:17:20 +08:00
{% if ansible_service_mgr in ["sysvinit","upstart"] %}
2016-01-22 21:25:33 +08:00
# Logging directory
KUBE_LOGGING="--log-dir={{ kube_log_dir }} --logtostderr=true"
{% else %}
# logging to stderr means we get it in the systemd journal
KUBE_LOGGING="--logtostderr=true"
{% endif %}
# Apiserver Log level, 0 is debug
2016-07-05 18:11:45 +08:00
KUBE_LOG_LEVEL="--v={{ kube_log_level | default('2') }}"
2016-01-22 21:25:33 +08:00
# Should this cluster be allowed to run privileged docker containers
KUBE_ALLOW_PRIV="--allow_privileged=true"
# The port on the local server to listen on.
KUBE_API_PORT="--insecure-port={{kube_apiserver_insecure_port}} --secure-port={{ kube_apiserver_port }}"
2016-06-24 23:10:01 +08:00
# Insecure API address (default is localhost)
2016-07-13 23:13:47 +08:00
KUBE_API_INSECURE_BIND="--insecure-bind-address={{ kube_apiserver_insecure_bind_address }}"
2016-06-24 23:10:01 +08:00
2016-01-22 21:25:33 +08:00
# Address range to use for services
KUBE_SERVICE_ADDRESSES="--service-cluster-ip-range={{ kube_service_addresses }}"
# Location of the etcd cluster
2016-07-11 22:05:05 +08:00
KUBE_ETCD_SERVERS="--etcd_servers={{ etcd_access_endpoint }}"
2016-01-22 21:25:33 +08:00
2016-07-02 06:28:28 +08:00
# Bind address for secure endpoint
KUBE_API_ADDRESS="--bind-address={{ ip | default(ansible_default_ipv4.address) }}"
2016-01-22 21:25:33 +08:00
# default admission control policies
2016-07-09 01:04:14 +08:00
KUBE_ADMISSION_CONTROL="--admission-control=NamespaceLifecycle,LimitRanger,ServiceAccount,ResourceQuota"
2016-01-22 21:25:33 +08:00
# RUNTIME API CONFIGURATION (e.g. enable extensions)
KUBE_RUNTIME_CONFIG="{% if kube_api_runtime_config is defined %}{% for conf in kube_api_runtime_config %}--runtime-config={{ conf }} {% endfor %}{% endif %}"
# TLS CONFIGURATION
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"
# Add you own!
2016-07-13 23:13:47 +08:00
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={{ kube_apiserver_address }}"
2016-01-22 21:25:33 +08:00
2016-03-29 20:50:22 +08:00
{% if cloud_provider is defined and cloud_provider == "openstack" %}
KUBELET_CLOUDPROVIDER="--cloud-provider={{ cloud_provider }} --cloud-config={{ kube_config_dir }}/cloud_config"
{% else %}
{# TODO: gce and aws don't need the cloud provider to be set? #}
KUBELET_CLOUDPROVIDER=""
{% endif %}
2016-02-13 18:17:20 +08:00
{% if ansible_service_mgr in ["sysvinit","upstart"] %}
2016-06-24 23:10:01 +08:00
DAEMON_ARGS="$KUBE_LOGGING $KUBE_LOG_LEVEL $KUBE_ALLOW_PRIV $KUBE_API_PORT $KUBE_API_INSECURE_BIND \
$KUBE_SERVICE_ADDRESSES $KUBE_ETCD_SERVERS $KUBE_ADMISSION_CONTROL $KUBE_RUNTIME_CONFIG \
$KUBE_TLS_CONFIG $KUBE_API_ARGS $KUBELET_CLOUDPROVIDER"
2016-01-22 21:25:33 +08:00
{% endif %}