deployment的每个Pod的id 重启后发生变化

[root@master Chapter7]# kubectl delete -f 7-2-deployment.yaml
deployment.apps “nginx” deleted
[root@master Chapter7]#

[root@master Chapter7]# kubectl get pod
NAME READY STATUS RESTARTS AGE
nfs-client-provisioner-6976b6b79c-fc99q 1/1 Running 6 16d
web-0 1/1 Running 5 16d
web-1 1/1 Running 6 19d
web-2 1/1 Running 5 18d
web-6db77f5fdb-dcw4b 1/1 Running 2 11d
[root@master Chapter7]#

[root@master Chapter7]# kubectl apply -f 7-2-deployment.yaml
deployment.apps/nginx created
[root@master Chapter7]#

[root@master Chapter7]# kubectl get pod
NAME READY STATUS RESTARTS AGE
nfs-client-provisioner-6976b6b79c-fc99q 1/1 Running 6 16d
nginx-649974ccc-b9htp 1/1 Running 0 9s
nginx-649974ccc-ltlcv 1/1 Running 0 9s
web-0 1/1 Running 5 16d
web-1 1/1 Running 6 19d
web-2 1/1 Running 5 18d
web-6db77f5fdb-dcw4b 1/1 Running 2 11d
[root@master Chapter7]#

[root@master Chapter7]# kubectl get pod
NAME READY STATUS RESTARTS AGE
nfs-client-provisioner-6976b6b79c-fc99q 1/1 Running 6 16d
nginx-649974ccc-rh648 1/1 Running 0 3s
nginx-649974ccc-wpl8g 1/1 Running 0 3s

[root@master Chapter7]# cat 7-2-deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx
spec:
replicas: 2
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: registry.cn-beijing.aliyuncs.com/qingfeng666/nginx:latest
resources:
limits:
memory: “128Mi”
cpu: “500m”
ports:
- containerPort: 80
[root@master Chapter7]#

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

tangruie

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值