Skip to content

Instantly share code, notes, and snippets.

@jkeam
Created April 25, 2021 18:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jkeam/5a506c80f8ed1a764a9db448a104982a to your computer and use it in GitHub Desktop.
Save jkeam/5a506c80f8ed1a764a9db448a104982a to your computer and use it in GitHub Desktop.
Clear Kube Config
#!/bin/bash
cat ~/.kube/config | yq e '.clusters.[].name' - | while read -r line; do oc config unset contexts.$line; done
cat ~/.kube/config | yq e '.contexts.[].name' - | while read -r line; do oc config unset contexts.$line; done
cat ~/.kube/config | yq e '.users.[].name' - | while read -r line; do oc config unset contexts.$line; done
echo 'done'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment