fix: improve argo remote cluster credentials reset

This commit is contained in:
2025-05-11 10:16:31 +02:00
parent 7de100a4d4
commit e511edefcd
5 changed files with 37 additions and 5 deletions
+8 -2
View File
@@ -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."