[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]#