Merge pull request #32018 from MrHohn/kubedns-deployment

Automatic merge from submit-queue

Use a Deployment for kube-dns

Attempt to fix #31554 

Switching kube-dns from using Replication Controller to Deployment.

The outdated kube-dns YAML file in coreos and juju dir is also updated. Most of the specific memory limit in the files remain unchanged because it seems like people were modifying it explicitly(c8d82fc2a9). Only the memory limit for healthz is increased due to this pending investigation(#29688).

YAML files stay in *-rc.yaml format considering there are a lots of scripts in cluster and hack dirs are using this format. But it may be fine to changed them all.

@bprashanth @girishkalele
This commit is contained in:
Kubernetes Submit Queue 2016-09-10 19:16:03 -07:00 committed by GitHub
commit fdd3cf89a2
5 changed files with 54 additions and 42 deletions

View File

@ -12,14 +12,12 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
# This file should be kept in sync with cluster/images/hyperkube/dns-rc.yaml
# TODO - At some point, we need to rename all skydns-*.yaml.* files to kubedns-*.yaml.* # TODO - At some point, we need to rename all skydns-*.yaml.* files to kubedns-*.yaml.*
# __MACHINE_GENERATED_WARNING__ # __MACHINE_GENERATED_WARNING__
apiVersion: v1 apiVersion: extensions/v1beta1
kind: ReplicationController kind: Deployment
metadata: metadata:
name: kube-dns-v19 name: kube-dns-v19
namespace: kube-system namespace: kube-system
@ -30,8 +28,9 @@ metadata:
spec: spec:
replicas: __PILLAR__DNS__REPLICAS__ replicas: __PILLAR__DNS__REPLICAS__
selector: selector:
k8s-app: kube-dns matchLabels:
version: v19 k8s-app: kube-dns
version: v19
template: template:
metadata: metadata:
labels: labels:

View File

@ -12,14 +12,12 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
# This file should be kept in sync with cluster/images/hyperkube/dns-rc.yaml
# TODO - At some point, we need to rename all skydns-*.yaml.* files to kubedns-*.yaml.* # TODO - At some point, we need to rename all skydns-*.yaml.* files to kubedns-*.yaml.*
# Warning: This is a file generated from the base underscore template file: skydns-rc.yaml.base # Warning: This is a file generated from the base underscore template file: skydns-rc.yaml.base
apiVersion: v1 apiVersion: extensions/v1beta1
kind: ReplicationController kind: Deployment
metadata: metadata:
name: kube-dns-v19 name: kube-dns-v19
namespace: kube-system namespace: kube-system
@ -30,8 +28,9 @@ metadata:
spec: spec:
replicas: {{ pillar['dns_replicas'] }} replicas: {{ pillar['dns_replicas'] }}
selector: selector:
k8s-app: kube-dns matchLabels:
version: v19 k8s-app: kube-dns
version: v19
template: template:
metadata: metadata:
labels: labels:

View File

@ -12,14 +12,12 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
# This file should be kept in sync with cluster/images/hyperkube/dns-rc.yaml
# TODO - At some point, we need to rename all skydns-*.yaml.* files to kubedns-*.yaml.* # TODO - At some point, we need to rename all skydns-*.yaml.* files to kubedns-*.yaml.*
# Warning: This is a file generated from the base underscore template file: skydns-rc.yaml.base # Warning: This is a file generated from the base underscore template file: skydns-rc.yaml.base
apiVersion: v1 apiVersion: extensions/v1beta1
kind: ReplicationController kind: Deployment
metadata: metadata:
name: kube-dns-v19 name: kube-dns-v19
namespace: kube-system namespace: kube-system
@ -30,8 +28,9 @@ metadata:
spec: spec:
replicas: $DNS_REPLICAS replicas: $DNS_REPLICAS
selector: selector:
k8s-app: kube-dns matchLabels:
version: v19 k8s-app: kube-dns
version: v19
template: template:
metadata: metadata:
labels: labels:

View File

@ -1,23 +1,27 @@
apiVersion: v1 apiVersion: extensions/v1beta1
kind: ReplicationController kind: Deployment
metadata: metadata:
name: kube-dns-v15 name: kube-dns-v19
namespace: kube-system namespace: kube-system
labels: labels:
k8s-app: kube-dns k8s-app: kube-dns
version: v15 version: v19
kubernetes.io/cluster-service: "true" kubernetes.io/cluster-service: "true"
spec: spec:
replicas: ${DNS_REPLICAS} replicas: ${DNS_REPLICAS}
selector: selector:
k8s-app: kube-dns matchLabels:
version: v15 k8s-app: kube-dns
version: v19
template: template:
metadata: metadata:
labels: labels:
k8s-app: kube-dns k8s-app: kube-dns
version: v15 version: v19
kubernetes.io/cluster-service: "true" kubernetes.io/cluster-service: "true"
annotations:
scheduler.alpha.kubernetes.io/critical-pod: ''
scheduler.alpha.kubernetes.io/tolerations: '[{"key":"CriticalAddonsOnly", "operator":"Exists"}]'
spec: spec:
containers: containers:
- name: kubedns - name: kubedns
@ -63,7 +67,7 @@ spec:
name: dns-tcp-local name: dns-tcp-local
protocol: TCP protocol: TCP
- name: dnsmasq - name: dnsmasq
image: gcr.io/google_containers/dnsmasq:1.1 image: gcr.io/google_containers/kube-dnsmasq-amd64:1.3
args: args:
- --cache-size=1000 - --cache-size=1000
- --no-resolv - --no-resolv
@ -76,18 +80,23 @@ spec:
name: dns-tcp name: dns-tcp
protocol: TCP protocol: TCP
- name: healthz - name: healthz
image: gcr.io/google_containers/exechealthz-amd64:1.0 image: gcr.io/google_containers/exechealthz-amd64:1.1
resources: resources:
# keep request = limit to keep this container in guaranteed class # keep request = limit to keep this container in guaranteed class
limits: limits:
cpu: 10m cpu: 10m
memory: 20Mi memory: 50Mi
requests: requests:
cpu: 10m cpu: 10m
memory: 20Mi # Note that this container shouldn't really need 50Mi of memory. The
# limits are set higher than expected pending investigation on #29688.
# The extra memory was stolen from the kubedns container to keep the
# net memory requested by the pod constant.
memory: 50Mi
args: args:
- -cmd=nslookup kubernetes.default.svc.${DNS_DOMAIN} 127.0.0.1 >/dev/null - -cmd=nslookup kubernetes.default.svc.${DNS_DOMAIN} 127.0.0.1 >/dev/null && nslookup kubernetes.default.svc.${DNS_DOMAIN} 127.0.0.1:10053 >/dev/null
- -port=8080 - -port=8080
- -quiet
ports: ports:
- containerPort: 8080 - containerPort: 8080
protocol: TCP protocol: TCP

View File

@ -12,30 +12,32 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
# This file should be kept in sync with cluster/images/hyperkube/dns-rc.yaml
# Warning: This is a file generated from the base underscore template file: skydns-rc.yaml.base # Warning: This is a file generated from the base underscore template file: skydns-rc.yaml.base
apiVersion: v1 apiVersion: extensions/v1beta1
kind: ReplicationController kind: Deployment
metadata: metadata:
name: kube-dns-v18 name: kube-dns-v19
namespace: kube-system namespace: kube-system
labels: labels:
k8s-app: kube-dns k8s-app: kube-dns
version: v18 version: v19
kubernetes.io/cluster-service: "true" kubernetes.io/cluster-service: "true"
spec: spec:
replicas: {{ pillar['dns_replicas'] }} replicas: {{ pillar['dns_replicas'] }}
selector: selector:
k8s-app: kube-dns matchLabels:
version: v18 k8s-app: kube-dns
version: v19
template: template:
metadata: metadata:
labels: labels:
k8s-app: kube-dns k8s-app: kube-dns
version: v18 version: v19
kubernetes.io/cluster-service: "true" kubernetes.io/cluster-service: "true"
annotations:
scheduler.alpha.kubernetes.io/critical-pod: ''
scheduler.alpha.kubernetes.io/tolerations: '[{"key":"CriticalAddonsOnly", "operator":"Exists"}]'
spec: spec:
containers: containers:
- name: kubedns - name: kubedns
@ -96,15 +98,19 @@ spec:
name: dns-tcp name: dns-tcp
protocol: TCP protocol: TCP
- name: healthz - name: healthz
image: gcr.io/google_containers/exechealthz-{{ arch }}:1.0 image: gcr.io/google_containers/exechealthz-{{ arch }}:1.1
resources: resources:
# keep request = limit to keep this container in guaranteed class # keep request = limit to keep this container in guaranteed class
limits: limits:
cpu: 10m cpu: 10m
memory: 20Mi memory: 50Mi
requests: requests:
cpu: 10m cpu: 10m
memory: 20Mi # Note that this container shouldn't really need 50Mi of memory. The
# limits are set higher than expected pending investigation on #29688.
# The extra memory was stolen from the kubedns container to keep the
# net memory requested by the pod constant.
memory: 50Mi
args: args:
- -cmd=nslookup kubernetes.default.svc.{{ pillar['dns_domain'] }} 127.0.0.1 >/dev/null && nslookup kubernetes.default.svc.{{ pillar['dns_domain'] }} 127.0.0.1:10053 >/dev/null - -cmd=nslookup kubernetes.default.svc.{{ pillar['dns_domain'] }} 127.0.0.1 >/dev/null && nslookup kubernetes.default.svc.{{ pillar['dns_domain'] }} 127.0.0.1:10053 >/dev/null
- -port=8080 - -port=8080