fix: improve argo remote cluster credentials reset
This commit is contained in:
@@ -1,9 +1,15 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo "reset ekman cluster admin token... "
|
||||
kubectl --context ekman delete -f ekman-cluster-admin-token.yaml
|
||||
sleep 1
|
||||
kubectl --context ekman apply -f ekman-cluster-admin-token.yaml
|
||||
|
||||
secret=$(kubectl --context ekman get secret -n kube-system | grep cluster-admin-token | cut -d' ' -f1)
|
||||
token=$(kubectl --context ekman get secret -n kube-system $secret -o yaml | grep ' token:' | cut -d' ' -f4 | base64 -d)
|
||||
sed -r "s/:\"ey[^\"]+/:\"$token/" ekman.yaml
|
||||
kubectl --context oceanbox apply -f ekman.yaml
|
||||
sed "s/@token@/$token/" ekman.yaml > _ekman.yaml
|
||||
echo "configure argocd ekman-cluster..."
|
||||
cat _ekman.yaml
|
||||
kubectl --context oceanbox apply -f _ekman.yaml
|
||||
echo "done."
|
||||
|
||||
|
||||
Reference in New Issue
Block a user