原因
修改deployment名称后,发现原来的deployment创建的pod还存在,使用kubectl delete pod name发现,pod删除后,又会重新创建一个pod
-deployment controller:管理维护deployment,关联deployment和deployment controller,保证运行指定数量的pod,当deployment 更新时,控制实现deployment controller和pod的更新。
获取并删除deployment
获取命令 kubectl get deployment
删除命令 kubectl delete deployment [deployment 名字]
[root@zjj101 ~]# kubectl get deployment
NAME READY UP-TO-DATE AVAILABLE AGE
nginx 1/1 1 1 46m
[root@zjj101 ~]# kubectl delete deployment nginx
deployment.apps "nginx" deleted
查看是否删除
[root@zjj101 ~]# kubectl get deployment
No resources found in default namespace.
删除了deployment之后 pod 也会被删除
[root@zjj101 ~]# kubectl get pod
No resources found in default namespace.