7-1 ReplicaSet 管理副本
ReolicaSet 的目的是维护一组在任何时候都处于运行状态的Pod副本的稳定集合
因此,它通常用来保证给定数量的,完全相同的pod的可用性
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 -l app=nginx
NAME READY STATUS RESTARTS AGE
nginx