Difference between revisions of "Kubectl delete"
Jump to navigation
Jump to search
Line 2: | Line 2: | ||
kubectl delete pod <PODNAME> --grace-period=0 --force --namespace <NAMESPACE> | kubectl delete pod <PODNAME> --grace-period=0 --force --namespace <NAMESPACE> | ||
kubectl -n my-namespace delete pod/mypod --grace-period=0 --force | kubectl -n my-namespace delete pod/mypod --grace-period=0 --force | ||
+ | ``` | ||
+ | |||
+ | # namespaces stuck in terminating statue | ||
+ | ``` | ||
+ | kubectl get namespace zabbix-dev -o json > tmp.json | ||
+ | ``` | ||
+ | |||
+ | ``` | ||
+ | remove kubernetes from finalizer line so it looks like | ||
+ | "spec": { | ||
+ | "finalizers": [ | ||
+ | ] | ||
+ | }, | ||
+ | ``` | ||
+ | |||
+ | ``` | ||
+ | kubectl replace --raw "/api/v1/namespaces/zabbix-dev/finalize" -f tmp.json | ||
``` | ``` |
Revision as of 20:58, 27 September 2022
kubectl delete pod <PODNAME> --grace-period=0 --force --namespace <NAMESPACE> kubectl -n my-namespace delete pod/mypod --grace-period=0 --force
namespaces stuck in terminating statue
kubectl get namespace zabbix-dev -o json > tmp.json
remove kubernetes from finalizer line so it looks like "spec": { "finalizers": [ ] },
kubectl replace --raw "/api/v1/namespaces/zabbix-dev/finalize" -f tmp.json