mirror of
				https://github.com/k3s-io/kubernetes.git
				synced 2025-11-03 23:40:03 +00:00 
			
		
		
		
	Merge pull request #37730 from MrHohn/dns-deployment-maxUnavailable
Automatic merge from submit-queue Set strategy spec for kube-dns to support zero downtime rolling update From #37728 and coreos/kube-aws#111. Set `maxUnavailable` to 0 to prevent DNS service outage during update when the replica number is only 1. Also keeps all kube-dns yaml files in sync. @bowei @thockin
This commit is contained in:
		@@ -31,6 +31,10 @@ spec:
 | 
				
			|||||||
  # 1. In order to make Addon Manager do not reconcile this replicas parameter.
 | 
					  # 1. In order to make Addon Manager do not reconcile this replicas parameter.
 | 
				
			||||||
  # 2. Default is 1.
 | 
					  # 2. Default is 1.
 | 
				
			||||||
  # 3. Will be tuned in real time if DNS horizontal auto-scaling is turned on.
 | 
					  # 3. Will be tuned in real time if DNS horizontal auto-scaling is turned on.
 | 
				
			||||||
 | 
					  strategy:
 | 
				
			||||||
 | 
					    rollingUpdate:
 | 
				
			||||||
 | 
					      maxSurge: 10%
 | 
				
			||||||
 | 
					      maxUnavailable: 0
 | 
				
			||||||
  selector:
 | 
					  selector:
 | 
				
			||||||
    matchLabels:
 | 
					    matchLabels:
 | 
				
			||||||
      k8s-app: kube-dns
 | 
					      k8s-app: kube-dns
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -31,6 +31,10 @@ spec:
 | 
				
			|||||||
  # 1. In order to make Addon Manager do not reconcile this replicas parameter.
 | 
					  # 1. In order to make Addon Manager do not reconcile this replicas parameter.
 | 
				
			||||||
  # 2. Default is 1.
 | 
					  # 2. Default is 1.
 | 
				
			||||||
  # 3. Will be tuned in real time if DNS horizontal auto-scaling is turned on.
 | 
					  # 3. Will be tuned in real time if DNS horizontal auto-scaling is turned on.
 | 
				
			||||||
 | 
					  strategy:
 | 
				
			||||||
 | 
					    rollingUpdate:
 | 
				
			||||||
 | 
					      maxSurge: 10%
 | 
				
			||||||
 | 
					      maxUnavailable: 0
 | 
				
			||||||
  selector:
 | 
					  selector:
 | 
				
			||||||
    matchLabels:
 | 
					    matchLabels:
 | 
				
			||||||
      k8s-app: kube-dns
 | 
					      k8s-app: kube-dns
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -31,6 +31,10 @@ spec:
 | 
				
			|||||||
  # 1. In order to make Addon Manager do not reconcile this replicas parameter.
 | 
					  # 1. In order to make Addon Manager do not reconcile this replicas parameter.
 | 
				
			||||||
  # 2. Default is 1.
 | 
					  # 2. Default is 1.
 | 
				
			||||||
  # 3. Will be tuned in real time if DNS horizontal auto-scaling is turned on.
 | 
					  # 3. Will be tuned in real time if DNS horizontal auto-scaling is turned on.
 | 
				
			||||||
 | 
					  strategy:
 | 
				
			||||||
 | 
					    rollingUpdate:
 | 
				
			||||||
 | 
					      maxSurge: 10%
 | 
				
			||||||
 | 
					      maxUnavailable: 0
 | 
				
			||||||
  selector:
 | 
					  selector:
 | 
				
			||||||
    matchLabels:
 | 
					    matchLabels:
 | 
				
			||||||
      k8s-app: kube-dns
 | 
					      k8s-app: kube-dns
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -11,6 +11,10 @@ spec:
 | 
				
			|||||||
  # 1. In order to make Addon Manager do not reconcile this replicas parameter.
 | 
					  # 1. In order to make Addon Manager do not reconcile this replicas parameter.
 | 
				
			||||||
  # 2. Default is 1.
 | 
					  # 2. Default is 1.
 | 
				
			||||||
  # 3. Will be tuned in real time if DNS horizontal auto-scaling is turned on.
 | 
					  # 3. Will be tuned in real time if DNS horizontal auto-scaling is turned on.
 | 
				
			||||||
 | 
					  strategy:
 | 
				
			||||||
 | 
					    rollingUpdate:
 | 
				
			||||||
 | 
					      maxSurge: 10%
 | 
				
			||||||
 | 
					      maxUnavailable: 0
 | 
				
			||||||
  selector:
 | 
					  selector:
 | 
				
			||||||
    matchLabels:
 | 
					    matchLabels:
 | 
				
			||||||
      k8s-app: kube-dns
 | 
					      k8s-app: kube-dns
 | 
				
			||||||
@@ -57,6 +61,7 @@ spec:
 | 
				
			|||||||
        # command = "/kube-dns"
 | 
					        # command = "/kube-dns"
 | 
				
			||||||
        - --domain=${DNS_DOMAIN}.
 | 
					        - --domain=${DNS_DOMAIN}.
 | 
				
			||||||
        - --dns-port=10053
 | 
					        - --dns-port=10053
 | 
				
			||||||
 | 
					        - --config-map=kube-dns
 | 
				
			||||||
        - --v=0
 | 
					        - --v=0
 | 
				
			||||||
        env:
 | 
					        env:
 | 
				
			||||||
          - name: PROMETHEUS_PORT
 | 
					          - name: PROMETHEUS_PORT
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -27,6 +27,10 @@ spec:
 | 
				
			|||||||
  # 1. In order to make Addon Manager do not reconcile this replicas parameter.
 | 
					  # 1. In order to make Addon Manager do not reconcile this replicas parameter.
 | 
				
			||||||
  # 2. Default is 1.
 | 
					  # 2. Default is 1.
 | 
				
			||||||
  # 3. Will be tuned in real time if DNS horizontal auto-scaling is turned on.
 | 
					  # 3. Will be tuned in real time if DNS horizontal auto-scaling is turned on.
 | 
				
			||||||
 | 
					  strategy:
 | 
				
			||||||
 | 
					    rollingUpdate:
 | 
				
			||||||
 | 
					      maxSurge: 10%
 | 
				
			||||||
 | 
					      maxUnavailable: 0
 | 
				
			||||||
  selector:
 | 
					  selector:
 | 
				
			||||||
    matchLabels:
 | 
					    matchLabels:
 | 
				
			||||||
      k8s-app: kube-dns
 | 
					      k8s-app: kube-dns
 | 
				
			||||||
@@ -40,7 +44,7 @@ spec:
 | 
				
			|||||||
    spec:
 | 
					    spec:
 | 
				
			||||||
      containers:
 | 
					      containers:
 | 
				
			||||||
      - name: kubedns
 | 
					      - name: kubedns
 | 
				
			||||||
        image: gcr.io/google_containers/kubedns-{{ arch }}:1.8
 | 
					        image: gcr.io/google_containers/kubedns-{{ arch }}:1.9
 | 
				
			||||||
        resources:
 | 
					        resources:
 | 
				
			||||||
          # TODO: Set memory limits when we've profiled the container for large
 | 
					          # TODO: Set memory limits when we've profiled the container for large
 | 
				
			||||||
          # clusters, then set request = limit to keep this container in
 | 
					          # clusters, then set request = limit to keep this container in
 | 
				
			||||||
@@ -73,6 +77,7 @@ spec:
 | 
				
			|||||||
        # command = "/kube-dns"
 | 
					        # command = "/kube-dns"
 | 
				
			||||||
        - --domain={{ pillar['dns_domain'] }}.
 | 
					        - --domain={{ pillar['dns_domain'] }}.
 | 
				
			||||||
        - --dns-port=10053
 | 
					        - --dns-port=10053
 | 
				
			||||||
 | 
					        - --config-map=kube-dns
 | 
				
			||||||
        - --v=0
 | 
					        - --v=0
 | 
				
			||||||
        - --kube_master_url=http://{{ private_address }}:8080
 | 
					        - --kube_master_url=http://{{ private_address }}:8080
 | 
				
			||||||
        {{ pillar['federations_domain_map'] }}
 | 
					        {{ pillar['federations_domain_map'] }}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user