From 59ad0af7be798f6381abeea399db6e0d9ae49e2f Mon Sep 17 00:00:00 2001 From: vinayak goyal Date: Fri, 23 Jul 2021 01:09:43 +0000 Subject: [PATCH] Don't create the manifest for kube-addon-manager if it is configured to run via CRP. Change-Id: I56279b5c1c0645b6798d5db4c0f736977915a3c6 --- gke/cluster/gce/gci/configure-helper.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/gke/cluster/gce/gci/configure-helper.sh b/gke/cluster/gce/gci/configure-helper.sh index 4c6c2f7a63317..01f9f3c62bbbe 100644 --- a/gke/cluster/gce/gci/configure-helper.sh +++ b/gke/cluster/gce/gci/configure-helper.sh @@ -2709,11 +2709,6 @@ function start-kube-addons { local -r src_dir="${KUBE_HOME}/kube-manifests/kubernetes/gci-trusty" local -r dst_dir="/etc/kubernetes/addons" - create-kubeconfig "addon-manager" "${ADDON_MANAGER_TOKEN}" - # User and group should never contain characters that need to be quoted - # shellcheck disable=SC2086 - prepare-log-file /var/log/kube-addon-manager.log ${KUBE_ADDON_MANAGER_RUNASUSER:-2002} - # prep addition kube-up specific rbac objects setup-addon-manifests "addons" "rbac/kubelet-api-auth" setup-addon-manifests "addons" "rbac/kubelet-cert-rotation" @@ -2889,6 +2884,14 @@ EOF copy-manifests "${src_dir}/gce-extras/in-place" "${dst_dir}/gce-extras/in-place" fi + if [[ "${KUBE_ADDON_MANAGER_CRP:-false}" == "true" ]]; then + echo "kube-addon-manager is configured to not be deployed through kube-up." + return + fi + create-kubeconfig "addon-manager" "${ADDON_MANAGER_TOKEN}" + # User and group should never contain characters that need to be quoted + # shellcheck disable=SC2086 + prepare-log-file /var/log/kube-addon-manager.log ${KUBE_ADDON_MANAGER_RUNASUSER:-2002} # Place addon manager pod manifest. src_file="${src_dir}/kube-addon-manager.yaml"