Skip to content

Commit

Permalink
Merge pull request #319 from openinfradev/fix_cluster_autoscaler_sa_t…
Browse files Browse the repository at this point in the history
…oken

Fix cluster autoscaler serviceaccount token
  • Loading branch information
ktkfree authored Nov 9, 2023
2 parents 81db063 + 6b93c21 commit 50a943b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tks-cluster/create-usercluster-wftpl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ spec:
- "-exc"
- |
cp /kube/value kubeconfig_adm
export KUBECONFIG=kubeconfig
export KUBECONFIG=kubeconfig_adm
cp /kube/value kubeconfig
Expand All @@ -644,7 +644,7 @@ spec:
ADMIN_CONTEXT=$1
ADMIN_USER=$2
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)
TOKEN=$(kubectl get secret -n {{workflow.parameters.cluster_id}} cluster-autoscaler-token -ojsonpath={.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
kubectl --kubeconfig kubeconfig config use-context cluster-autoscaler
Expand Down

0 comments on commit 50a943b

Please sign in to comment.