A collection of useful kubectl
commands.
kubectl run psql -i --tty --image=jbergknoff/postgresql-client --restart=Never --command --namespace=<mynamespace> -- bash
[...]
kubectl delete pod psql --namespace=<mynamespace>
kubectl run my-shell --rm -i --tty --image ubuntu -- bash
kubectl delete jobs --namespace=<mynamespace> $(kubectl get jobs --namespace=<mynamespace> -o custom-columns=:.metadata.name)
kubectl delete pods --namespace <namespace> --field-selector=status.phase==Succeeded
kubectl --namespace <namespace> delete $(kubectl --namespace <namespace> get all | grep replicaset.apps | grep "0 0 0" | cut -d' ' -f 1)
kubectl patch crd/<CRD> -p '{"metadata":{"finalizers":[]}}' --type=merge
and then delete all objects.