Skip to content

Instantly share code, notes, and snippets.

@gregdhill
Created October 24, 2018 13:27
Show Gist options
  • Save gregdhill/8d4dc0e7823182b62bc02b24f7e249fe to your computer and use it in GitHub Desktop.
Save gregdhill/8d4dc0e7823182b62bc02b24f7e249fe to your computer and use it in GitHub Desktop.
Point to your kube context's namespace.
kgn () {
current_namespace=$(kubectl config get-contexts --no-headers | awk '{print $5}')
kubectl get namespaces | awk '{if ($0 ~ /'"$current_namespace"'/) { print $0, "\t<-----" } else { print $0 }}'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment