From 5f743adfe301cbff580aab2af4edfbe9484f2916 Mon Sep 17 00:00:00 2001 From: Jugwan Eom Date: Mon, 4 Apr 2022 05:14:14 +0000 Subject: [PATCH] use admin cluster name in the default namespace --- tks-cluster/create-usercluster-wftpl.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tks-cluster/create-usercluster-wftpl.yaml b/tks-cluster/create-usercluster-wftpl.yaml index 47b9389d..c8f980af 100644 --- a/tks-cluster/create-usercluster-wftpl.yaml +++ b/tks-cluster/create-usercluster-wftpl.yaml @@ -188,8 +188,8 @@ spec: - | cp /kube/value kubeconfig - CLUSTER=tks-admin-v2 - ADMIN_USER=tks-admin-v2-admin + CLUSTER=$(kubectl --kubeconfig kubeconfig get cl -ojsonpath='{.items[0].metadata.name}') + ADMIN_USER=${CLUSTER}-admin TOKEN=$(kubectl --kubeconfig kubeconfig get secrets -n {{workflow.parameters.cluster_id}} "$(kubectl --kubeconfig kubeconfig get sa cluster-autoscaler -n {{workflow.parameters.cluster_id}} -o=jsonpath={.secrets[0].name})" -o=jsonpath={.data.token} | base64 -d) kubectl --kubeconfig kubeconfig config set-credentials cluster-autoscaler --token=$TOKEN kubectl --kubeconfig kubeconfig config set-context cluster-autoscaler --cluster=$CLUSTER --user=cluster-autoscaler