From 2da12db222d176b59c07dc905c8c039078a8d9c6 Mon Sep 17 00:00:00 2001 From: Oleh Ozimok Date: Sat, 2 Sep 2017 18:16:03 +0300 Subject: [PATCH] [stable/coredns fix prometheus metrics (#1748) --- stable/coredns/Chart.yaml | 2 +- stable/coredns/templates/configmap.yaml | 2 +- stable/coredns/templates/deployment.yaml | 5 +++++ stable/coredns/templates/service.yaml | 5 +++++ 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/stable/coredns/Chart.yaml b/stable/coredns/Chart.yaml index c9a5645fa5e1..26e74c420ec3 100644 --- a/stable/coredns/Chart.yaml +++ b/stable/coredns/Chart.yaml @@ -1,5 +1,5 @@ name: coredns -version: 0.3.0 +version: 0.4.0 description: CoreDNS is a DNS server that chains middleware and provides Kubernetes DNS Services keywords: - coredns diff --git a/stable/coredns/templates/configmap.yaml b/stable/coredns/templates/configmap.yaml index 727c596ccff6..a0cc63400a40 100644 --- a/stable/coredns/templates/configmap.yaml +++ b/stable/coredns/templates/configmap.yaml @@ -31,7 +31,7 @@ data: health {{- end }} {{- if eq "prometheus" $key }} - prometheus localhost:{{ $middleware.port }} + prometheus 0.0.0.0:{{ $middleware.port }} {{- end }} {{- if eq "proxy" $key }} proxy . /etc/resolv.conf diff --git a/stable/coredns/templates/deployment.yaml b/stable/coredns/templates/deployment.yaml index 1cac0c96bc45..ea90fee872f6 100644 --- a/stable/coredns/templates/deployment.yaml +++ b/stable/coredns/templates/deployment.yaml @@ -61,6 +61,11 @@ spec: name: dns-tcp protocol: TCP {{- end }} + {{- if .Values.middleware.prometheus.enabled }} + - containerPort: {{ .Values.middleware.prometheus.port }} + name: metrics + protocol: TCP + {{- end }} livenessProbe: httpGet: path: /health diff --git a/stable/coredns/templates/service.yaml b/stable/coredns/templates/service.yaml index 66c5fbc1413a..6e107e3095d8 100644 --- a/stable/coredns/templates/service.yaml +++ b/stable/coredns/templates/service.yaml @@ -39,4 +39,9 @@ spec: port: 53 protocol: TCP {{- end }} + {{- if .Values.middleware.prometheus.enabled }} + - name: metrics + port: {{ .Values.middleware.prometheus.port }} + protocol: TCP + {{- end }} type: {{ default "ClusterIP" .Values.serviceType }}