标签:net 官方文档 Kubernete ada ref kubectl href contain cas
RS与Deployment主要用于替代RC。RS的全称为Replica Set。相对于RC,RS与Deployment的优势如下:
Replica Set目前与RC的区别只是支持的selector不同,后续会加入更多的功能。Deployment使用了Replica Set,是更高一层的概念。除非需要自定义升级功能或者根本不需要升级Pod,否则还是建议使用Deployment而不直接使用Replica Set。
Deployment的配置与RC基本相同,详细配置可以参考官方文档下面直接给出一个配置示例deployment.yml内容如下:
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: hello-deployment
spec:
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxSurge: 10%
      maxUnavailable: 0     
  replicas: 3
  template:
    metadata:
      labels:
        name: hello-deployment
    spec:
      containers:
      - name: pod
        image: index.tenxcloud.com/tailnode/hello:v1.0
        ports:
        - containerPort:80需要说明的是strategy部分,用于定义deployment的升级策略。具体的deployment滚动升级的详细操作可以参考另一篇文章《Service滚动更新》。这里简单说下这几个配置项的意义:
创建deployment:
kubectl create -f deployment.yml --recodeKubernetes Deployment与Replica Set
标签:net 官方文档 Kubernete ada ref kubectl href contain cas
原文地址:https://www.cnblogs.com/breezey/p/8810094.html