From 5d1eab9d9f896f6adf5a31a17c43995377a93f78 Mon Sep 17 00:00:00 2001 From: Lingxian Kong Date: Fri, 2 Nov 2018 18:38:07 +1300 Subject: [PATCH] [K8S] Pass cluster name to controller-manager The cluster name is useful to identify resources created in different k8s clusters, especially in the cloud environment, the cluster name is always injected into the name of the cloud resources(e.g. the load balancer, volume, etc.), which is helpful for the cluster resource clean up. The magnum cluster UUID is used as the value of '--cluster-name' option. Story: 2004242 Task: 27766 Change-Id: I245a8869948a0b8bfa8d5cc32e7fb9277477026a --- .../kubernetes/fragments/configure-kubernetes-master.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/magnum/drivers/common/templates/kubernetes/fragments/configure-kubernetes-master.sh b/magnum/drivers/common/templates/kubernetes/fragments/configure-kubernetes-master.sh index 232c21ab01..fc5ca4aa91 100644 --- a/magnum/drivers/common/templates/kubernetes/fragments/configure-kubernetes-master.sh +++ b/magnum/drivers/common/templates/kubernetes/fragments/configure-kubernetes-master.sh @@ -90,6 +90,7 @@ sed -i ' # Add controller manager args KUBE_CONTROLLER_MANAGER_ARGS="--leader-elect=true" +KUBE_CONTROLLER_MANAGER_ARGS="$KUBE_CONTROLLER_MANAGER_ARGS --cluster-name=${CLUSTER_UUID}" KUBE_CONTROLLER_MANAGER_ARGS="$KUBE_CONTROLLER_MANAGER_ARGS $KUBECONTROLLER_OPTIONS" if [ -n "${ADMISSION_CONTROL_LIST}" ] && [ "${TLS_DISABLED}" == "False" ]; then KUBE_CONTROLLER_MANAGER_ARGS="$KUBE_CONTROLLER_MANAGER_ARGS --service-account-private-key-file=$CERT_DIR/service_account_private.key --root-ca-file=$CERT_DIR/ca.crt"