sábado, 21 de septiembre de 2024

Delete all resources from Kubernetes one time

To delete all resources from a Kubernetes cluster at once, you can use the kubectl delete command along with specific flags to target all resources in a namespace or across the entire cluster. 

For example:

[ec2-user@ip-172-31-80-45 ~]$ kubectl delete all --all

pod "hello-v1-755b64fbf5-6ch2t" deleted

pod "hello-v1-755b64fbf5-cdcn9" deleted

pod "hello-v1-755b64fbf5-lxl49" deleted

pod "hello-v2-58cb678cff-fpthc" deleted

pod "hello-v2-58cb678cff-hth7k" deleted

pod "hello-v2-58cb678cff-vl6s9" deleted

service "hello-v1-svc" deleted

service "hello-v2-svc" deleted

service "kubernetes" deleted

deployment.apps "hello-v1" deleted

deployment.apps "hello-v2" deleted




[ec2-user@ip-172-31-80-45 ~]$ kubectl delete all --all -n nginx-ingress

pod "nginx-ingress-75fc77c9fc-mxrlk" deleted

service "nginx-ingress" deleted

deployment.apps "nginx-ingress" deleted

No hay comentarios:

Publicar un comentario