Skip to content
This repository was archived by the owner on Jul 30, 2021. It is now read-only.

Commit 911f0df

Browse files
authored
Merge pull request #179 from brancz/expose-metrics
expose skydns and dnsmasq metrics
2 parents e55162b + 77006a4 commit 911f0df

File tree

1 file changed

+42
-4
lines changed

1 file changed

+42
-4
lines changed

pkg/asset/internal/templates.go

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,10 @@ metadata:
310310
k8s-app: kube-dns
311311
kubernetes.io/cluster-service: "true"
312312
spec:
313-
replicas: 1
313+
# replicas: not specified here:
314+
# 1. In order to make Addon Manager do not reconcile this replicas parameter.
315+
# 2. Default is 1.
316+
# 3. Will be tuned in real time if DNS horizontal auto-scaling is turned on.
314317
selector:
315318
matchLabels:
316319
k8s-app: kube-dns
@@ -324,7 +327,7 @@ spec:
324327
spec:
325328
containers:
326329
- name: kubedns
327-
image: gcr.io/google_containers/kubedns-amd64:1.8
330+
image: gcr.io/google_containers/kubedns-amd64:1.9
328331
resources:
329332
# TODO: Set memory limits when we've profiled the container for large
330333
# clusters, then set request = limit to keep this container in
@@ -354,16 +357,25 @@ spec:
354357
initialDelaySeconds: 3
355358
timeoutSeconds: 5
356359
args:
357-
# command = "/kube-dns"
358360
- --domain=cluster.local.
359361
- --dns-port=10053
362+
- --config-map=kube-dns
363+
# This should be set to v=2 only after the new image (cut from 1.5) has
364+
# been released, otherwise we will flood the logs.
365+
- --v=0
366+
env:
367+
- name: PROMETHEUS_PORT
368+
value: "10055"
360369
ports:
361370
- containerPort: 10053
362371
name: dns-local
363372
protocol: UDP
364373
- containerPort: 10053
365374
name: dns-tcp-local
366375
protocol: TCP
376+
- containerPort: 10055
377+
name: metrics
378+
protocol: TCP
367379
- name: dnsmasq
368380
image: gcr.io/google_containers/kube-dnsmasq-amd64:1.4
369381
livenessProbe:
@@ -387,6 +399,32 @@ spec:
387399
- containerPort: 53
388400
name: dns-tcp
389401
protocol: TCP
402+
# see: https://github.com/kubernetes/kubernetes/issues/29055 for details
403+
resources:
404+
requests:
405+
cpu: 150m
406+
memory: 10Mi
407+
- name: dnsmasq-metrics
408+
image: gcr.io/google_containers/dnsmasq-metrics-amd64:1.0
409+
livenessProbe:
410+
httpGet:
411+
path: /metrics
412+
port: 10054
413+
scheme: HTTP
414+
initialDelaySeconds: 60
415+
timeoutSeconds: 5
416+
successThreshold: 1
417+
failureThreshold: 5
418+
args:
419+
- --v=2
420+
- --logtostderr
421+
ports:
422+
- containerPort: 10054
423+
name: metrics
424+
protocol: TCP
425+
resources:
426+
requests:
427+
memory: 10Mi
390428
- name: healthz
391429
image: gcr.io/google_containers/exechealthz-amd64:1.2
392430
resources:
@@ -423,7 +461,7 @@ metadata:
423461
spec:
424462
selector:
425463
k8s-app: kube-dns
426-
clusterIP: 10.3.0.10
464+
clusterIP: 10.3.0.10
427465
ports:
428466
- name: dns
429467
port: 53

0 commit comments

Comments
 (0)