Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How does kubernates delete pod?

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces "how kubernate deletes pod". In daily operation, I believe many people have doubts about how kubernate deletes pod. Xiaobian consulted all kinds of information and sorted out simple and easy operation methods. I hope it will help you answer the doubts about "how kubernate deletes pod"! Next, please follow the small series to learn together!

Delete the pod, use the following command, find that it does not take effect, after execution, it will still be recreated

[root@localhost data]# kubectl delete pods example-demo-94f66596d-k2rgw --grace-period=0 --force warning: Immediate deletion does not wait for confirmation that the running resource has been terminated. The resource may continue to run on the cluster indefinitely. pod "example-demo-94f66596d-k2rgw" force deleted

On stackoverflow, see a (https://stackoverflow. com/questions/40686151/kubernetes-pod-gets-recreated-when-deleted), valid

View all deployments [root@localhost data]# kubectl get deployments --all-namespaces NAMESPACE NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE default example-demo 1 1 1 1 2h default example-demo2 1 1 1 1 2h default example-demo3 1 1 1 1 1h default example-demo4 2 2 2 2 52m kube-system coredns 2 2 2 2 4h kube-system heapster 1 1 1 1 4h kube-system kubernetes-dashboard 1 1 1 1 4h kube-system monitoring-grafana 1 1 1 1 4h kube-system monitoring-influxdb 1 1 1 1 4h To delete deployment, use the command "kubectl delete -n NAMESPACE deployment DEPLOYMENT" as follows [root@localhost data]# kubectl delete -n default deployment example-demo [root@localhost data]# kubectl delete -n default deployment example-demo2 [root@localhost data]# kubectl delete -n default deployment example-demo3 [root@localhost data]# kubectl delete -n default deployment example-demo4 Then check the pods information, as follows, so that the pod is really deleted [root@localhost data]# kubectl get pods No resources found. At this point, the study of "kubernates how to delete pod" is over, hoping to solve everyone's doubts. Theory and practice can better match to help everyone learn, go and try it! If you want to continue learning more relevant knowledge, please continue to pay attention to the website, Xiaobian will continue to strive to bring more practical articles for everyone!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report