Useful Scripts for managing K8s
Getting all resources in namespace 1 2 3 kubectl api-resources --verbs=list --namespaced -o name \ | xargs -n 1 kubectl get --show-kind --ignore-not-found \ -l <label>=<value> -n $namespace Remove terminating namespace using remove-terminating-namespace.sh to remove the namespace that is stuck in the status Terminating 1 2 3 4 5 6 7 8 9 10 # remove-terminating-namespace.sh if [[ $# -ne 1 ]]; then echo "Please input only namespace name" exit 1 fi ns=$1 kubectl get ns ${ns} -o json > tmp....