diff --git a/cluster/aws/config-default.sh b/cluster/aws/config-default.sh index 1abbf3a18cc..7013eec1873 100644 --- a/cluster/aws/config-default.sh +++ b/cluster/aws/config-default.sh @@ -81,8 +81,13 @@ MASTER_IP_RANGE="${MASTER_IP_RANGE:-10.246.0.0/24}" # If set to auto, a new Elastic IP will be acquired # Otherwise amazon-given public ip will be used (it'll change with reboot). MASTER_RESERVED_IP="${MASTER_RESERVED_IP:-}" + +# Runtime config RUNTIME_CONFIG="${KUBE_RUNTIME_CONFIG:-}" -ENABLE_EXPERIMENTAL_API="${KUBE_ENABLE_EXPERIMENTAL_API:-false}" + +# Enable various v1beta1 features +ENABLE_DEPLOYMENTS="${KUBE_ENABLE_DEPLOYMENTS:-}" +ENABLE_DAEMONSETS="${KUBE_ENABLE_DAEMONSETS:-}" # Optional: Cluster monitoring to setup as part of the cluster bring up: # none - No cluster monitoring setup @@ -120,12 +125,6 @@ if [[ "${ENABLE_NODE_AUTOSCALER}" == "true" ]]; then TARGET_NODE_UTILIZATION="${KUBE_TARGET_NODE_UTILIZATION:-0.7}" 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,ResourceQuota diff --git a/cluster/aws/config-test.sh b/cluster/aws/config-test.sh index 04e36bfed80..0a38279de5c 100755 --- a/cluster/aws/config-test.sh +++ b/cluster/aws/config-test.sh @@ -80,7 +80,10 @@ MASTER_IP_RANGE="${MASTER_IP_RANGE:-10.246.0.0/24}" # Otherwise amazon-given public ip will be used (it'll change with reboot). MASTER_RESERVED_IP="${MASTER_RESERVED_IP:-}" RUNTIME_CONFIG="${KUBE_RUNTIME_CONFIG:-}" -ENABLE_EXPERIMENTAL_API="${KUBE_ENABLE_EXPERIMENTAL_API:-false}" + +# Enable various v1beta1 features +ENABLE_DEPLOYMENTS="${KUBE_ENABLE_DEPLOYMENTS:-}" +ENABLE_DAEMONSETS="${KUBE_ENABLE_DAEMONSETS:-}" # Optional: Cluster monitoring to setup as part of the cluster bring up: # none - No cluster monitoring setup @@ -118,12 +121,6 @@ if [[ "${ENABLE_NODE_AUTOSCALER}" == "true" ]]; then TARGET_NODE_UTILIZATION="${KUBE_TARGET_NODE_UTILIZATION:-0.7}" 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,ResourceQuota diff --git a/cluster/aws/templates/create-dynamic-salt-files.sh b/cluster/aws/templates/create-dynamic-salt-files.sh index a2d03c5cc4a..54c81dfc442 100644 --- a/cluster/aws/templates/create-dynamic-salt-files.sh +++ b/cluster/aws/templates/create-dynamic-salt-files.sh @@ -44,12 +44,6 @@ num_nodes: $(echo "${NUM_MINIONS}") e2e_storage_test_environment: '$(echo "$E2E_STORAGE_TEST_ENVIRONMENT" | sed -e "s/'/''/g")' EOF -if [ -n "${ENABLE_EXPERIMENTAL_API:-}" ]; then - cat <>/srv/salt-overlay/pillar/cluster-params.sls -enable_experimental_api: '$(echo "$ENABLE_EXPERIMENTAL_API" | sed -e "s/'/''/g")' -EOF -fi - readonly BASIC_AUTH_FILE="/srv/salt-overlay/salt/kube-apiserver/basic_auth.csv" if [ ! -e "${BASIC_AUTH_FILE}" ]; then mkdir -p /srv/salt-overlay/salt/kube-apiserver diff --git a/cluster/aws/util.sh b/cluster/aws/util.sh index 53093d55f9d..9101ec4c48e 100755 --- a/cluster/aws/util.sh +++ b/cluster/aws/util.sh @@ -468,24 +468,7 @@ function create-dhcp-option-set () { # Verify prereqs function verify-prereqs { - if [[ "${ENABLE_EXPERIMENTAL_API}" == "true" ]]; then - if [[ -z "${RUNTIME_CONFIG}" ]]; then - RUNTIME_CONFIG="extensions/v1beta1=true" - else - # TODO: add checking if RUNTIME_CONFIG contains "extensions/v1beta1=false" and appending "extensions/v1beta1=true" if not. - if echo "${RUNTIME_CONFIG}" | grep -q -v "extensions/v1beta1=true"; then - echo "Experimental API should be turned on, but is not turned on in RUNTIME_CONFIG!" - exit 1 - fi - fi - fi - if [[ "${ENABLE_DEPLOYMENTS}" == "true" ]]; then - if [[ -z "${RUNTIME_CONFIG}" ]]; then - RUNTIME_CONFIG="extensions/v1beta1/deployments=true" - else - RUNTIME_CONFIG="${RUNTIME_CONFIG},extensions/v1beta1/deployments=true" - fi - fi + build-runtime-config if [[ "$(which aws)" == "" ]]; then echo "Can't find aws in PATH, please fix and retry." @@ -885,7 +868,6 @@ function start-master() { echo "readonly ELASTICSEARCH_LOGGING_REPLICAS='${ELASTICSEARCH_LOGGING_REPLICAS:-}'" echo "readonly ENABLE_CLUSTER_DNS='${ENABLE_CLUSTER_DNS:-false}'" echo "readonly ENABLE_CLUSTER_UI='${ENABLE_CLUSTER_UI:-false}'" - echo "readonly ENABLE_EXPERIMENTAL_API='${ENABLE_EXPERIMENTAL_API:-false}'" echo "readonly RUNTIME_CONFIG='${RUNTIME_CONFIG}'" echo "readonly DNS_REPLICAS='${DNS_REPLICAS:-}'" echo "readonly DNS_SERVER_IP='${DNS_SERVER_IP:-}'" @@ -1433,3 +1415,25 @@ function get-tokens() { KUBELET_TOKEN=$(dd if=/dev/urandom bs=128 count=1 2>/dev/null | base64 | tr -d "=+/" | dd bs=32 count=1 2>/dev/null) KUBE_PROXY_TOKEN=$(dd if=/dev/urandom bs=128 count=1 2>/dev/null | base64 | tr -d "=+/" | dd bs=32 count=1 2>/dev/null) } + +# Builds the RUNTIME_CONFIG var from other feature enable options +function build-runtime-config() { + if [[ "${ENABLE_DEPLOYMENTS}" == "true" ]]; then + if [[ -z "${RUNTIME_CONFIG}" ]]; then + RUNTIME_CONFIG="extensions/v1beta1/deployments=true" + else + if echo "${RUNTIME_CONFIG}" | grep -q -v "extensions/v1beta1/deployments=true"; then + RUNTIME_CONFIG="${RUNTIME_CONFIG},extensions/v1beta1/deployments=true" + fi + fi + fi + if [[ "${ENABLE_DAEMONSETS}" == "true" ]]; then + if [[ -z "${RUNTIME_CONFIG}" ]]; then + RUNTIME_CONFIG="extensions/v1beta1/daemonsets=true" + else + if echo "${RUNTIME_CONFIG}" | grep -q -v "extensions/v1beta1/daemonsets=true"; then + RUNTIME_CONFIG="${RUNTIME_CONFIG},extensions/v1beta1/daemonsets=true" + fi + fi + fi +} diff --git a/cluster/gce/config-default.sh b/cluster/gce/config-default.sh index 2161fe73831..2e5235ab977 100755 --- a/cluster/gce/config-default.sh +++ b/cluster/gce/config-default.sh @@ -44,8 +44,6 @@ MINION_TAG="${INSTANCE_PREFIX}-minion" MASTER_IP_RANGE="${MASTER_IP_RANGE:-10.246.0.0/24}" CLUSTER_IP_RANGE="${CLUSTER_IP_RANGE:-10.244.0.0/16}" MINION_SCOPES="${MINION_SCOPES:-compute-rw,monitoring,logging-write,storage-ro}" -RUNTIME_CONFIG="${KUBE_RUNTIME_CONFIG:-}" -ENABLE_EXPERIMENTAL_API="${KUBE_ENABLE_EXPERIMENTAL_API:-false}" # Increase the sleep interval value if concerned about API rate limits. 3, in seconds, is the default. POLL_SLEEP_INTERVAL="${POLL_SLEEP_INTERVAL:-3}" @@ -77,6 +75,13 @@ if [[ ${KUBE_ENABLE_INSECURE_REGISTRY:-false} == "true" ]]; then EXTRA_DOCKER_OPTS="--insecure-registry 10.0.0.0/8" fi +# Optional: customize runtime config +RUNTIME_CONFIG="${KUBE_RUNTIME_CONFIG:-}" + +# Optional: enable v1beta1 related features +ENABLE_DEPLOYMENTS="${KUBE_ENABLE_DEPLOYMENTS:-}" +ENABLE_DAEMONSETS="${KUBE_ENABLE_DAEMONSETS:-}" + # Optional: Install cluster DNS. ENABLE_CLUSTER_DNS="${KUBE_ENABLE_CLUSTER_DNS:-true}" DNS_SERVER_IP="10.0.0.10" @@ -101,17 +106,6 @@ if [[ "${ENABLE_NODE_AUTOSCALER}" == "true" ]]; then ENABLE_CLUSTER_MONITORING=googleinfluxdb 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 -# Optional: Enable daemonset experimental feature, not ready for production use. -ENABLE_DAEMONSETS="${KUBE_ENABLE_DAEMONSETS:-false}" -if [[ "${ENABLE_DAEMONSETS}" == "true" ]]; then - ENABLE_EXPERIMENTAL_API=true -fi - # Admission Controllers to invoke prior to persisting objects in cluster ADMISSION_CONTROL=NamespaceLifecycle,LimitRanger,ServiceAccount,ResourceQuota diff --git a/cluster/gce/config-test.sh b/cluster/gce/config-test.sh index 94208af0220..0d48c663fe0 100755 --- a/cluster/gce/config-test.sh +++ b/cluster/gce/config-test.sh @@ -46,9 +46,12 @@ CLUSTER_IP_RANGE="${CLUSTER_IP_RANGE:-10.245.0.0/16}" MASTER_IP_RANGE="${MASTER_IP_RANGE:-10.246.0.0/24}" MINION_SCOPES="${MINION_SCOPES:-compute-rw,monitoring,logging-write,storage-ro}" RUNTIME_CONFIG="${KUBE_RUNTIME_CONFIG:-}" -ENABLE_EXPERIMENTAL_API="${KUBE_ENABLE_EXPERIMENTAL_API:-true}" TERMINATED_POD_GC_THRESHOLD=${TERMINATED_POD_GC_THRESHOLD:-100} +# Optional: enable v1beta1 related features +ENABLE_DEPLOYMENTS="${KUBE_ENABLE_DEPLOYMENTS:-true}" +ENABLE_DAEMONSETS="${KUBE_ENABLE_DAEMONSETS:-true}" + # Increase the sleep interval value if concerned about API rate limits. 3, in seconds, is the default. POLL_SLEEP_INTERVAL=3 SERVICE_CLUSTER_IP_RANGE="10.0.0.0/16" # formerly PORTAL_NET @@ -110,18 +113,6 @@ if [[ "${ENABLE_NODE_AUTOSCALER}" == "true" ]]; then TARGET_NODE_UTILIZATION="${KUBE_TARGET_NODE_UTILIZATION:-0.7}" fi -# Optional: Enable deployment experimental feature, not ready for production use. -ENABLE_DEPLOYMENTS="${KUBE_ENABLE_DEPLOYMENTS:-true}" -if [[ "${ENABLE_DEPLOYMENTS}" == "true" ]]; then - ENABLE_EXPERIMENTAL_API=true -fi - -# Optional: Enable daemonset experimental feature, not ready for production use. -ENABLE_DAEMONSETS="${KUBE_ENABLE_DAEMONSETS:-true}" -if [[ "${ENABLE_DAEMONSETS}" == "true" ]]; then - ENABLE_EXPERIMENTAL_API=true -fi - ADMISSION_CONTROL="${KUBE_ADMISSION_CONTROL:-NamespaceLifecycle,LimitRanger,SecurityContextDeny,ServiceAccount,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 d7c9b0da67f..72176cbfc34 100755 --- a/cluster/gce/configure-vm.sh +++ b/cluster/gce/configure-vm.sh @@ -320,11 +320,6 @@ EOF cluster_registry_disk_type: gce cluster_registry_disk_size: $(convert-bytes-gce-kube ${CLUSTER_REGISTRY_DISK_SIZE}) cluster_registry_disk_name: ${CLUSTER_REGISTRY_DISK} -EOF - fi - if [ -n "${ENABLE_EXPERIMENTAL_API:-}" ]; then - cat <>/srv/salt-overlay/pillar/cluster-params.sls -enable_experimental_api: '$(echo "$ENABLE_EXPERIMENTAL_API" | sed -e "s/'/''/g")' EOF fi if [ -n "${TERMINATED_POD_GC_THRESHOLD:-}" ]; then diff --git a/cluster/gce/coreos/helper.sh b/cluster/gce/coreos/helper.sh index 067ba4599a7..a6eecb7d673 100755 --- a/cluster/gce/coreos/helper.sh +++ b/cluster/gce/coreos/helper.sh @@ -58,7 +58,6 @@ KUBELET_TOKEN: $(yaml-quote ${KUBELET_TOKEN:-}) KUBE_PROXY_TOKEN: $(yaml-quote ${KUBE_PROXY_TOKEN:-}) ADMISSION_CONTROL: $(yaml-quote ${ADMISSION_CONTROL:-}) MASTER_IP_RANGE: $(yaml-quote ${MASTER_IP_RANGE}) -ENABLE_EXPERIMENTAL_API: $(yaml-quote ${ENABLE_EXPERIMENTAL_API}) 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 694bcc10b54..ad01714c657 100755 --- a/cluster/gce/debian/helper.sh +++ b/cluster/gce/debian/helper.sh @@ -54,7 +54,6 @@ KUBELET_TOKEN: $(yaml-quote ${KUBELET_TOKEN:-}) KUBE_PROXY_TOKEN: $(yaml-quote ${KUBE_PROXY_TOKEN:-}) ADMISSION_CONTROL: $(yaml-quote ${ADMISSION_CONTROL:-}) MASTER_IP_RANGE: $(yaml-quote ${MASTER_IP_RANGE}) -ENABLE_EXPERIMENTAL_API: $(yaml-quote ${ENABLE_EXPERIMENTAL_API}) RUNTIME_CONFIG: $(yaml-quote ${RUNTIME_CONFIG}) CA_CERT: $(yaml-quote ${CA_CERT_BASE64:-}) KUBELET_CERT: $(yaml-quote ${KUBELET_CERT_BASE64:-}) diff --git a/cluster/gce/util.sh b/cluster/gce/util.sh index 63e2bb6fd53..e481eb40ab4 100755 --- a/cluster/gce/util.sh +++ b/cluster/gce/util.sh @@ -1234,29 +1234,22 @@ function prepare-e2e() { # Builds the RUNTIME_CONFIG var from other feature enable options function build-runtime-config() { - if [[ "${ENABLE_EXPERIMENTAL_API}" == "true" ]]; then - if [[ -z "${RUNTIME_CONFIG}" ]]; then - RUNTIME_CONFIG="extensions/v1beta1=true" - else - # TODO: add checking if RUNTIME_CONFIG contains "extensions/v1beta1=false" and appending "extensions/v1beta1=true" if not. - if echo "${RUNTIME_CONFIG}" | grep -q -v "extensions/v1beta1=true"; then - echo "Experimental API should be turned on, but is not turned on in RUNTIME_CONFIG!" >&2 - exit 1 - fi - fi - fi if [[ "${ENABLE_DEPLOYMENTS}" == "true" ]]; then if [[ -z "${RUNTIME_CONFIG}" ]]; then RUNTIME_CONFIG="extensions/v1beta1/deployments=true" else - RUNTIME_CONFIG="${RUNTIME_CONFIG},extensions/v1beta1/deployments=true" + if echo "${RUNTIME_CONFIG}" | grep -q -v "extensions/v1beta1/deployments=true"; then + RUNTIME_CONFIG="${RUNTIME_CONFIG},extensions/v1beta1/deployments=true" + fi fi fi if [[ "${ENABLE_DAEMONSETS}" == "true" ]]; then if [[ -z "${RUNTIME_CONFIG}" ]]; then RUNTIME_CONFIG="extensions/v1beta1/daemonsets=true" else - RUNTIME_CONFIG="${RUNTIME_CONFIG},extensions/v1beta1/daemonsets=true" + if echo "${RUNTIME_CONFIG}" | grep -q -v "extensions/v1beta1/daemonsets=true"; then + RUNTIME_CONFIG="${RUNTIME_CONFIG},extensions/v1beta1/daemonsets=true" + fi fi fi } diff --git a/cluster/kubemark/config-default.sh b/cluster/kubemark/config-default.sh index fbeca826b0a..9cc3d83040e 100644 --- a/cluster/kubemark/config-default.sh +++ b/cluster/kubemark/config-default.sh @@ -39,7 +39,6 @@ MASTER_TAG="kubemark-master" MASTER_IP_RANGE="${MASTER_IP_RANGE:-10.246.0.0/24}" CLUSTER_IP_RANGE="${CLUSTER_IP_RANGE:-10.244.0.0/16}" RUNTIME_CONFIG="${KUBE_RUNTIME_CONFIG:-}" -ENABLE_EXPERIMENTAL_API="${KUBE_ENABLE_EXPERIMENTAL_API:-false}" # Increase the sleep interval value if concerned about API rate limits. 3, in seconds, is the default. POLL_SLEEP_INTERVAL=3 diff --git a/cluster/vagrant/config-default.sh b/cluster/vagrant/config-default.sh index be817012209..2a8609b6a05 100755 --- a/cluster/vagrant/config-default.sh +++ b/cluster/vagrant/config-default.sh @@ -55,9 +55,6 @@ MASTER_PASSWD=vagrant # Admission Controllers to invoke prior to persisting objects in cluster ADMISSION_CONTROL=NamespaceLifecycle,LimitRanger,SecurityContextDeny,ServiceAccount,ResourceQuota -# Optional: Enable experimental API features -ENABLE_EXPERIMENTAL_API="${KUBE_ENABLE_EXPERIMENTAL_API:-true}" - # Optional: Enable node logging. ENABLE_NODE_LOGGING=false LOGGING_DESTINATION=elasticsearch diff --git a/cluster/vagrant/util.sh b/cluster/vagrant/util.sh index 16dd93e8f1c..b4ddc99fbb8 100644 --- a/cluster/vagrant/util.sh +++ b/cluster/vagrant/util.sh @@ -34,18 +34,6 @@ function detect-minions { # Verify prereqs on host machine Also sets exports USING_KUBE_SCRIPTS=true so # that our Vagrantfile doesn't error out. function verify-prereqs { - if [[ "${ENABLE_EXPERIMENTAL_API}" == "true" ]]; then - if [[ -z "${RUNTIME_CONFIG}" ]]; then - RUNTIME_CONFIG="extensions/v1beta1" - else - # TODO: add checking if RUNTIME_CONFIG contains "experimental/v1=false" and appending "experimental/v1=true" if not. - if echo "${RUNTIME_CONFIG}" | grep -q -v "extensions/v1beta1=true"; then - echo "Experimental API should be turned on, but is not turned on in RUNTIME_CONFIG!" - exit 1 - fi - fi - fi - for x in vagrant; do if ! which "$x" >/dev/null; then echo "Can't find $x in PATH, please fix and retry."