replication controller
2020-07-20 本文已影响0人
Ucan先生
rc 副本控制器,在k8s中,确保k8s的高可用性,确保任何时间都有pod在k8s中运行。特性支持滚动升级和升级回滚。
rc在生成pod的使用会使用rc-name+随机名称
滚动更新策略: ,一一 进行创建逐步替换操作。
apiVersion: v1
kind: ReplicationController
metadata:
name: testnginx
spec:
replicas: 2
selector:
app : testnginx
template:
metadata:
labels:
app: testnginx
spec:
containers:
- name: nginx
image: nginx:1.13
ports:
- containerPort: 80
imagePullPolicy: IfNotPresent
rc通过selector中的标签对对应的pod进行统一管理
kubectl get rc
kubectl rolling-update testnginx testnginx01-rc.yml --update-period=60
kubectl scale rc rc_name --replicas=3 扩容