Skip to content

Commit

Permalink
update config context
Browse files Browse the repository at this point in the history
  • Loading branch information
topahadzi committed Oct 27, 2023
1 parent 93e0541 commit 7ce2ac5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ if [ -z "$NODE_NAMES" ]; then
fi

for NODE_NAME in $NODE_NAMES; do
kubectl config set-context default --cluster kubernetes --user=service-account
kubectl config set-cluster kubernetes --certificate-authority=/var/run/secrets/kubernetes.io/serviceaccount/ca.crt --server=https://kubernetes.default.svc
kubectl config set-credentials sa --token $(cat /var/run/secrets/kubernetes.io/serviceaccount/token)
kubectl config set-context default --cluster kubernetes --user=sa
kubectl config use-context default
echo "Running command on node: $NODE_NAME"
kubectl node_shell $NODE_NAME -- reboot
Expand Down

0 comments on commit 7ce2ac5

Please sign in to comment.