From ed5d24ed528ec8b0f34425815449607f781e9f73 Mon Sep 17 00:00:00 2001 From: nikhiljindal Date: Wed, 23 Sep 2015 18:20:51 -0700 Subject: [PATCH] Allow enabling deployment controller on GCE and GKE --- cluster/gce/config-default.sh | 6 ++++++ cluster/gce/config-test.sh | 6 ++++++ cluster/gce/configure-vm.sh | 5 +++++ cluster/gce/coreos/helper.sh | 1 + cluster/gce/debian/helper.sh | 1 + .../kube-controller-manager.manifest | 6 +++++- hack/verify-flags/exceptions.txt | 2 +- 7 files changed, 25 insertions(+), 2 deletions(-) diff --git a/cluster/gce/config-default.sh b/cluster/gce/config-default.sh index bad0776c227..a90499cf0f0 100755 --- a/cluster/gce/config-default.sh +++ b/cluster/gce/config-default.sh @@ -103,6 +103,12 @@ if [[ "${ENABLE_HORIZONTAL_POD_AUTOSCALER}" == "true" ]]; then ENABLE_EXPERIMENTAL_API=true fi +# Optional: Enable deployment experimental feature, not ready for production use. +ENABLE_DEPLOYMENTS="${KUBE_ENABLE_DEPLOYMENTS:-false}" +if [[ "${ENABLE_DEPLOYMENTS}" == "true" ]]; then + ENABLE_EXPERIMENTAL_API=true +fi + # Admission Controllers to invoke prior to persisting objects in cluster ADMISSION_CONTROL=NamespaceLifecycle,LimitRanger,SecurityContextDeny,ServiceAccount,DenyEscalatingExec,ResourceQuota diff --git a/cluster/gce/config-test.sh b/cluster/gce/config-test.sh index b9b4895ca3c..fdca00ca537 100755 --- a/cluster/gce/config-test.sh +++ b/cluster/gce/config-test.sh @@ -111,6 +111,12 @@ if [[ "${ENABLE_HORIZONTAL_POD_AUTOSCALER}" == "true" ]]; then ENABLE_EXPERIMENTAL_API=true fi +# Optional: Enable deployment experimental feature, not ready for production use. +ENABLE_DEPLOYMENTS="${KUBE_ENABLE_DEPLOYMENTS:-false}" +if [[ "${ENABLE_DEPLOYMENTS}" == "true" ]]; then + ENABLE_EXPERIMENTAL_API=true +fi + ADMISSION_CONTROL=NamespaceLifecycle,LimitRanger,SecurityContextDeny,ServiceAccount,DenyEscalatingExec,ResourceQuota # Optional: if set to true kube-up will automatically check for existing resources and clean them up. diff --git a/cluster/gce/configure-vm.sh b/cluster/gce/configure-vm.sh index eaf65b89dbd..5894be5fe17 100644 --- a/cluster/gce/configure-vm.sh +++ b/cluster/gce/configure-vm.sh @@ -315,6 +315,11 @@ EOF if [ -n "${ENABLE_HORIZONTAL_POD_AUTOSCALER:-}" ]; then cat <>/srv/salt-overlay/pillar/cluster-params.sls enable_horizontal_pod_autoscaler: '$(echo "$ENABLE_HORIZONTAL_POD_AUTOSCALER" | sed -e "s/'/''/g")' +EOF + fi + if [ -n "${ENABLE_DEPLOYMENTS:-}" ]; then + cat <>/srv/salt-overlay/pillar/cluster-params.sls +enable_deployments: '$(echo "$ENABLE_DEPLOYMENTS" | sed -e "s/'/''/g")' EOF fi } diff --git a/cluster/gce/coreos/helper.sh b/cluster/gce/coreos/helper.sh index f3113aa0eba..553f9493cb1 100755 --- a/cluster/gce/coreos/helper.sh +++ b/cluster/gce/coreos/helper.sh @@ -57,6 +57,7 @@ KUBE_PROXY_TOKEN: $(yaml-quote ${KUBE_PROXY_TOKEN:-}) ADMISSION_CONTROL: $(yaml-quote ${ADMISSION_CONTROL:-}) MASTER_IP_RANGE: $(yaml-quote ${MASTER_IP_RANGE}) ENABLE_HORIZONTAL_POD_AUTOSCALER: $(yaml-quote ${ENABLE_HORIZONTAL_POD_AUTOSCALER}) +ENABLE_DEPLOYMENTS: $(yaml-quote ${ENABLE_DEPLOYMENTS}) RUNTIME_CONFIG: $(yaml-quote ${RUNTIME_CONFIG}) KUBERNETES_MASTER_NAME: $(yaml-quote ${MASTER_NAME}) KUBERNETES_CONTAINER_RUNTIME: $(yaml-quote ${CONTAINER_RUNTIME}) diff --git a/cluster/gce/debian/helper.sh b/cluster/gce/debian/helper.sh index da45a8a56ab..08dd9785509 100755 --- a/cluster/gce/debian/helper.sh +++ b/cluster/gce/debian/helper.sh @@ -52,6 +52,7 @@ KUBE_PROXY_TOKEN: $(yaml-quote ${KUBE_PROXY_TOKEN:-}) ADMISSION_CONTROL: $(yaml-quote ${ADMISSION_CONTROL:-}) MASTER_IP_RANGE: $(yaml-quote ${MASTER_IP_RANGE}) ENABLE_HORIZONTAL_POD_AUTOSCALER: $(yaml-quote ${ENABLE_HORIZONTAL_POD_AUTOSCALER}) +ENABLE_DEPLOYMENTS: $(yaml-quote ${ENABLE_DEPLOYMENTS}) RUNTIME_CONFIG: $(yaml-quote ${RUNTIME_CONFIG}) CA_CERT: $(yaml-quote ${CA_CERT_BASE64:-}) KUBELET_CERT: $(yaml-quote ${KUBELET_CERT_BASE64:-}) diff --git a/cluster/saltbase/salt/kube-controller-manager/kube-controller-manager.manifest b/cluster/saltbase/salt/kube-controller-manager/kube-controller-manager.manifest index a4f82888a01..6f6a28d1646 100644 --- a/cluster/saltbase/salt/kube-controller-manager/kube-controller-manager.manifest +++ b/cluster/saltbase/salt/kube-controller-manager/kube-controller-manager.manifest @@ -2,6 +2,7 @@ {% set cluster_cidr = "" -%} {% set allocate_node_cidrs = "" -%} {% set enable_horizontal_pod_autoscaler = "" -%} +{% set enable_deployments = "" -%} {% if pillar['instance_prefix'] is defined -%} {% set cluster_name = "--cluster-name=" + pillar['instance_prefix'] -%} @@ -15,6 +16,9 @@ {% if pillar['enable_horizontal_pod_autoscaler'] is defined -%} {% set enable_horizontal_pod_autoscaler = "--enable-horizontal-pod-autoscaler=" + pillar['enable_horizontal_pod_autoscaler'] -%} {% endif -%} +{% if pillar['enable_deployments'] is defined -%} + {% set enable_deployments = "--enable-deployment-controller=" + pillar['enable_deployments'] -%} +{% endif -%} {% set cloud_provider = "" -%} {% set cloud_config = "" -%} @@ -38,7 +42,7 @@ {% set root_ca_file = "--root-ca-file=/srv/kubernetes/ca.crt" -%} {% endif -%} -{% set params = "--master=127.0.0.1:8080" + " " + cluster_name + " " + cluster_cidr + " " + allocate_node_cidrs + " " + enable_horizontal_pod_autoscaler + " " + cloud_provider + " " + cloud_config + service_account_key + pillar['log_level'] + " " + root_ca_file -%} +{% set params = "--master=127.0.0.1:8080" + " " + cluster_name + " " + cluster_cidr + " " + allocate_node_cidrs + " " + enable_horizontal_pod_autoscaler + " " + enable_deployments + " " + cloud_provider + " " + cloud_config + service_account_key + pillar['log_level'] + " " + root_ca_file -%} # test_args has to be kept at the end, so they'll overwrite any prior configuration {% if pillar['controller_manager_test_args'] is defined -%} diff --git a/hack/verify-flags/exceptions.txt b/hack/verify-flags/exceptions.txt index c541cc21188..aecb17aadb1 100644 --- a/hack/verify-flags/exceptions.txt +++ b/hack/verify-flags/exceptions.txt @@ -38,7 +38,7 @@ cluster/saltbase/salt/kube-addons/kube-addons.sh:# Create admission_control obje cluster/saltbase/salt/kube-admission-controls/init.sls:{% if 'LimitRanger' in pillar.get('admission_control', '') %} cluster/saltbase/salt/kube-apiserver/kube-apiserver.manifest:{% set params = address + " " + etcd_servers + " " + cloud_provider + " " + cloud_config + " " + runtime_config + " " + admission_control + " " + service_cluster_ip_range + " " + client_ca_file + " " + basic_auth_file + " " + min_request_timeout -%} cluster/saltbase/salt/kube-apiserver/kube-apiserver.manifest:{% set params = params + " " + cluster_name + " " + cert_file + " " + key_file + " --secure-port=" + secure_port + " " + token_auth_file + " " + bind_address + " " + pillar['log_level'] + " " + advertise_address + " " + proxy_ssh_options -%} -cluster/saltbase/salt/kube-controller-manager/kube-controller-manager.manifest:{% set params = "--master=127.0.0.1:8080" + " " + cluster_name + " " + cluster_cidr + " " + allocate_node_cidrs + " " + enable_horizontal_pod_autoscaler + " " + cloud_provider + " " + cloud_config + service_account_key + pillar['log_level'] + " " + root_ca_file -%} +cluster/saltbase/salt/kube-controller-manager/kube-controller-manager.manifest:{%set params = "--master=127.0.0.1:8080" + " " + cluster_name + " " + cluster_cidr + " " + allocate_node_cidrs + " " + enable_horizontal_pod_autoscaler + " " + enable_deployments + " " + cloud_provider + " " + cloud_config + service_account_key + pillar['log_level'] + " " + root_ca_file -%} cluster/saltbase/salt/kube-proxy/default: {% set api_servers_with_port = api_servers -%} cluster/saltbase/salt/kube-proxy/default: {% set api_servers_with_port = api_servers + ":6443" -%} cluster/saltbase/salt/kube-proxy/default: {% set api_servers_with_port = api_servers + ":7080" -%}