From ff144a17eaae79043702b801c1939b6e1b5b153c Mon Sep 17 00:00:00 2001 From: Stavros Foteinopoulos Date: Thu, 20 Feb 2020 11:41:32 +0200 Subject: [PATCH] Add node-local-dns headless service --- .../addons/dns/nodelocaldns/nodelocaldns.yaml | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/cluster/addons/dns/nodelocaldns/nodelocaldns.yaml b/cluster/addons/dns/nodelocaldns/nodelocaldns.yaml index d8a1ead5a2a..603c8dfdc60 100644 --- a/cluster/addons/dns/nodelocaldns/nodelocaldns.yaml +++ b/cluster/addons/dns/nodelocaldns/nodelocaldns.yaml @@ -188,3 +188,24 @@ spec: items: - key: Corefile path: Corefile.base +--- +# A headless service is a service with a service IP but instead of load-balancing it will return the IPs of our associated Pods. +# We use this to expose metrics to Prometheus. +apiVersion: v1 +kind: Service +metadata: + annotations: + prometheus.io/port: "9253" + prometheus.io/scrape: "true" + labels: + k8s-app: node-local-dns + name: node-local-dns + namespace: kube-system +spec: + clusterIP: None + ports: + - name: metrics + port: 9253 + targetPort: 9253 + selector: + k8s-app: node-local-dns \ No newline at end of file