pod的重启方法
//先将复制因子置为0[root@k8s1 ~]# kubectl scale deployment nginx-deployment --replicas=0 -n defaultdeployment.apps/nginx-deployment scaled[root@k8s1 ~]# kubectl get podsNo resources found in default namespace
//先将复制因子置为0
[root@k8s1 ~]# kubectl scale deployment nginx-deployment --replicas=0 -n default
deployment.apps/nginx-deployment scaled
[root@k8s1 ~]# kubectl get pods
No resources found in default namespace.
[root@k8s1 ~]# kubectl get pods -o wide
No resources found in default namespace.
再恢复
[root@k8s1 ~]# kubectl scale deployment nginx-deployment --replicas=2 -n default
deployment.apps/nginx-deployment scaled
[root@k8s1 ~]# kubectl get pods -o wide
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
nginx-deployment-585449566-jt46k 0/1 ContainerCreating 0 3s <none> k8s3 <none> <none>
nginx-deployment-585449566-llhpw 0/1 ContainerCreating 0 3s <none> k8s2 <none> <none>
[root@k8s1 ~]# kubectl get pods -o wide
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
nginx-deployment-585449566-jt46k 0/1 ErrImagePull 0 49s 10.244.2.11 k8s3 <none> <none>
nginx-deployment-585449566-llhpw 0/1 ContainerCreating 0 49s <none> k8s2 <none> <none>
更多推荐
所有评论(0)