起因是想将学习添加的一些服务全部删掉, 然后直接执行kubect delete pods,services, 提示删除成功, 执行kubectl get pods发现删掉的pods重新启动, 然后想到, 其实我们部署的是deployment, 也就是说, pods只是一个执行的实体, 而不是需要删除的服务.
一个pod的生成方式有:
执行
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
| [root@tiku-172017010223 ~]# kubectl get deployments NAME READY UP-TO-DATE AVAILABLE AGE fantastic-hare-traefik 1/1 1 1 45h hello-minikube 0/1 1 0 47h web 0/1 1 0 69m [root@tiku-172017010223 ~]# kubectl get rs NAME DESIRED CURRENT READY AGE fantastic-hare-traefik-9ffd4cffb 1 1 1 6m38s hello-minikube-56cdb79778 1 1 0 6m38s web-ddb799d85 1 1 0 6m38s [root@tiku-172017010223 ~]# kubectl get rc No resources found.
[root@tiku-172017010223 ~]# kubectl delete deployments,rs,rc --all deployment.extensions "fantastic-hare-traefik" deleted deployment.extensions "hello-minikube" deleted deployment.extensions "web" deleted replicaset.extensions "fantastic-hare-traefik-9ffd4cffb" deleted replicaset.extensions "hello-minikube-56cdb79778" deleted replicaset.extensions "web-ddb799d85" deleted [root@tiku-172017010223 ~]# kubectl get rs No resources found. [root@tiku-172017010223 ~]# kubectl get pods No resources found. [root@tiku-172017010223 ~]# kubectl get rc No resources found. [root@tiku-172017010223 ~]# kubectl get rs No resources found.
|