From 29c7775ea139fcc634b3a50c3244e2067e90361a Mon Sep 17 00:00:00 2001 From: "Zinin D.A" Date: Tue, 11 Sep 2018 20:07:25 +0300 Subject: [PATCH] Monitor CoreDNS over svc --- .../ansible/templates/coredns-svc.yml.j2 | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/roles/kubernetes-apps/ansible/templates/coredns-svc.yml.j2 b/roles/kubernetes-apps/ansible/templates/coredns-svc.yml.j2 index 193de10eb..7f08d17ca 100644 --- a/roles/kubernetes-apps/ansible/templates/coredns-svc.yml.j2 +++ b/roles/kubernetes-apps/ansible/templates/coredns-svc.yml.j2 @@ -9,14 +9,21 @@ metadata: kubernetes.io/cluster-service: "true" addonmanager.kubernetes.io/mode: Reconcile kubernetes.io/name: "CoreDNS" + annotations: + prometheus.io/path: /metrics + prometheus.io/port: "9153" + prometheus.io/scrape: "true" spec: selector: k8s-app: coredns{{ coredns_ordinal_suffix | default('') }} clusterIP: {{ clusterIP }} ports: - - name: dns - port: 53 - protocol: UDP - - name: dns-tcp - port: 53 - protocol: TCP + - name: dns + port: 53 + protocol: UDP + - name: dns-tcp + port: 53 + protocol: TCP + - name: metrics + port: 9153 + protocol: TCP