switch context kubectl code example
Example 1: kubectl list context
# list kubernets contexts
kubectl config get-contexts
Example 2: kubectl edit secret
kubectl get secret mysecret -o json | jq '.data["foo"]="YmFy"' | kubectl apply -f -
# list kubernets contexts
kubectl config get-contexts
kubectl get secret mysecret -o json | jq '.data["foo"]="YmFy"' | kubectl apply -f -