Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fdd3cf8

Browse files
author
Kubernetes Submit Queue
authored
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(c8d82fc). 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
2 parents f27f607 + b5c17fa commit fdd3cf8

5 files changed

Lines changed: 54 additions & 42 deletions

File tree

cluster/addons/dns/skydns-rc.yaml.base

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,12 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
# This file should be kept in sync with cluster/images/hyperkube/dns-rc.yaml
16-
1715
# TODO - At some point, we need to rename all skydns-*.yaml.* files to kubedns-*.yaml.*
1816

1917
# __MACHINE_GENERATED_WARNING__
2018

21-
apiVersion: v1
22-
kind: ReplicationController
19+
apiVersion: extensions/v1beta1
20+
kind: Deployment
2321
metadata:
2422
name: kube-dns-v19
2523
namespace: kube-system
@@ -30,8 +28,9 @@ metadata:
3028
spec:
3129
replicas: __PILLAR__DNS__REPLICAS__
3230
selector:
33-
k8s-app: kube-dns
34-
version: v19
31+
matchLabels:
32+
k8s-app: kube-dns
33+
version: v19
3534
template:
3635
metadata:
3736
labels:

cluster/addons/dns/skydns-rc.yaml.in

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,12 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
# This file should be kept in sync with cluster/images/hyperkube/dns-rc.yaml
16-
1715
# TODO - At some point, we need to rename all skydns-*.yaml.* files to kubedns-*.yaml.*
1816

1917
# Warning: This is a file generated from the base underscore template file: skydns-rc.yaml.base
2018

21-
apiVersion: v1
22-
kind: ReplicationController
19+
apiVersion: extensions/v1beta1
20+
kind: Deployment
2321
metadata:
2422
name: kube-dns-v19
2523
namespace: kube-system
@@ -30,8 +28,9 @@ metadata:
3028
spec:
3129
replicas: {{ pillar['dns_replicas'] }}
3230
selector:
33-
k8s-app: kube-dns
34-
version: v19
31+
matchLabels:
32+
k8s-app: kube-dns
33+
version: v19
3534
template:
3635
metadata:
3736
labels:

cluster/addons/dns/skydns-rc.yaml.sed

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,12 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
# This file should be kept in sync with cluster/images/hyperkube/dns-rc.yaml
16-
1715
# TODO - At some point, we need to rename all skydns-*.yaml.* files to kubedns-*.yaml.*
1816

1917
# Warning: This is a file generated from the base underscore template file: skydns-rc.yaml.base
2018

21-
apiVersion: v1
22-
kind: ReplicationController
19+
apiVersion: extensions/v1beta1
20+
kind: Deployment
2321
metadata:
2422
name: kube-dns-v19
2523
namespace: kube-system
@@ -30,8 +28,9 @@ metadata:
3028
spec:
3129
replicas: $DNS_REPLICAS
3230
selector:
33-
k8s-app: kube-dns
34-
version: v19
31+
matchLabels:
32+
k8s-app: kube-dns
33+
version: v19
3534
template:
3635
metadata:
3736
labels:

cluster/gce/coreos/kube-manifests/addons/dns/skydns-rc.yaml

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,27 @@
1-
apiVersion: v1
2-
kind: ReplicationController
1+
apiVersion: extensions/v1beta1
2+
kind: Deployment
33
metadata:
4-
name: kube-dns-v15
4+
name: kube-dns-v19
55
namespace: kube-system
66
labels:
77
k8s-app: kube-dns
8-
version: v15
8+
version: v19
99
kubernetes.io/cluster-service: "true"
1010
spec:
1111
replicas: ${DNS_REPLICAS}
1212
selector:
13-
k8s-app: kube-dns
14-
version: v15
13+
matchLabels:
14+
k8s-app: kube-dns
15+
version: v19
1516
template:
1617
metadata:
1718
labels:
1819
k8s-app: kube-dns
19-
version: v15
20+
version: v19
2021
kubernetes.io/cluster-service: "true"
22+
annotations:
23+
scheduler.alpha.kubernetes.io/critical-pod: ''
24+
scheduler.alpha.kubernetes.io/tolerations: '[{"key":"CriticalAddonsOnly", "operator":"Exists"}]'
2125
spec:
2226
containers:
2327
- name: kubedns
@@ -63,7 +67,7 @@ spec:
6367
name: dns-tcp-local
6468
protocol: TCP
6569
- name: dnsmasq
66-
image: gcr.io/google_containers/dnsmasq:1.1
70+
image: gcr.io/google_containers/kube-dnsmasq-amd64:1.3
6771
args:
6872
- --cache-size=1000
6973
- --no-resolv
@@ -76,18 +80,23 @@ spec:
7680
name: dns-tcp
7781
protocol: TCP
7882
- name: healthz
79-
image: gcr.io/google_containers/exechealthz-amd64:1.0
83+
image: gcr.io/google_containers/exechealthz-amd64:1.1
8084
resources:
8185
# keep request = limit to keep this container in guaranteed class
8286
limits:
8387
cpu: 10m
84-
memory: 20Mi
88+
memory: 50Mi
8589
requests:
8690
cpu: 10m
87-
memory: 20Mi
91+
# Note that this container shouldn't really need 50Mi of memory. The
92+
# limits are set higher than expected pending investigation on #29688.
93+
# The extra memory was stolen from the kubedns container to keep the
94+
# net memory requested by the pod constant.
95+
memory: 50Mi
8896
args:
89-
- -cmd=nslookup kubernetes.default.svc.${DNS_DOMAIN} 127.0.0.1 >/dev/null
97+
- -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
9098
- -port=8080
99+
- -quiet
91100
ports:
92101
- containerPort: 8080
93102
protocol: TCP

cluster/juju/layers/kubernetes/templates/kubedns-rc.yaml

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,30 +12,32 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
# This file should be kept in sync with cluster/images/hyperkube/dns-rc.yaml
16-
1715
# Warning: This is a file generated from the base underscore template file: skydns-rc.yaml.base
1816

19-
apiVersion: v1
20-
kind: ReplicationController
17+
apiVersion: extensions/v1beta1
18+
kind: Deployment
2119
metadata:
22-
name: kube-dns-v18
20+
name: kube-dns-v19
2321
namespace: kube-system
2422
labels:
2523
k8s-app: kube-dns
26-
version: v18
24+
version: v19
2725
kubernetes.io/cluster-service: "true"
2826
spec:
2927
replicas: {{ pillar['dns_replicas'] }}
3028
selector:
31-
k8s-app: kube-dns
32-
version: v18
29+
matchLabels:
30+
k8s-app: kube-dns
31+
version: v19
3332
template:
3433
metadata:
3534
labels:
3635
k8s-app: kube-dns
37-
version: v18
36+
version: v19
3837
kubernetes.io/cluster-service: "true"
38+
annotations:
39+
scheduler.alpha.kubernetes.io/critical-pod: ''
40+
scheduler.alpha.kubernetes.io/tolerations: '[{"key":"CriticalAddonsOnly", "operator":"Exists"}]'
3941
spec:
4042
containers:
4143
- name: kubedns
@@ -96,15 +98,19 @@ spec:
9698
name: dns-tcp
9799
protocol: TCP
98100
- name: healthz
99-
image: gcr.io/google_containers/exechealthz-{{ arch }}:1.0
101+
image: gcr.io/google_containers/exechealthz-{{ arch }}:1.1
100102
resources:
101103
# keep request = limit to keep this container in guaranteed class
102104
limits:
103105
cpu: 10m
104-
memory: 20Mi
106+
memory: 50Mi
105107
requests:
106108
cpu: 10m
107-
memory: 20Mi
109+
# Note that this container shouldn't really need 50Mi of memory. The
110+
# limits are set higher than expected pending investigation on #29688.
111+
# The extra memory was stolen from the kubedns container to keep the
112+
# net memory requested by the pod constant.
113+
memory: 50Mi
108114
args:
109115
- -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
110116
- -port=8080

0 commit comments

Comments
 (0)