美文网首页
replication controller

replication controller

作者: Ucan先生 | 来源:发表于2020-07-20 00:05 被阅读0次

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 扩容

相关文章

网友评论

      本文标题:replication controller

      本文链接:https://www.haomeiwen.com/subject/lmmdkktx.html