7-1 使用replicaset 控制副本
[root@master Chapter7]# cat 7-1-replicaSet.yaml
apiVersion: apps/v1
kind: ReplicaSet
metadata:
name: nginx
spec:
replicas: 3
selector:
matchLabels:
app: nginx
template:
metadata:
name: nginx
labels:
app: nginx
spec:
containers:
- name: nginx
image: registry.cn-beijing.aliyuncs.com/qingfeng666/nginx:latest
ports:
- containerPort: 80
[root@master Chapter7]# kubectl get pod
NAME READY STATUS RESTARTS AGE
busybox-1 1/1 Running