the reason
After modifying the deployment name, it is found that the pod created by the original deployment still exists. Use kubectl delete pod name to find out that after the pod is deleted, a pod will be recreated
-deployment controller: Manage and maintain deployment, associate deployment with deployment controller, and ensure that a specified number of pods are running. When deployment is updated, control the implementation of deployment controller and pod updates.
Obtain and delete deployment
Get the command kubectl get deployment
Delete command kubectl delete deployment [deployment name]
[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
Check whether to delete
[root@zjj101 ~]# kubectl get deployment
No resources found in default namespace.
After the deployment is deleted, the pod will also be deleted
[root@zjj101 ~]# kubectl get pod
No resources found in default namespace.