Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: Enable DNS Metrics #345

Closed
malachma opened this issue May 2, 2018 · 9 comments
Closed

Enhancement: Enable DNS Metrics #345

malachma opened this issue May 2, 2018 · 9 comments

Comments

@malachma
Copy link
Member

malachma commented May 2, 2018

This is an Enhancement/Feature Request

Currently kube-dns does not expose the dns-metrics, either via the Standard port 10055 or any other port.
Due to the missing dns-metrics port external monitoring Solutions like datadog are not able to be used, as they expect the metrics port open and available.

@slack
Copy link
Contributor

slack commented May 10, 2018

This is a good call, I've created a ticket in our backlog to track.

@ghost
Copy link

ghost commented May 23, 2018

+1

Having these metrics would be quite useful.

@mfpierre
Copy link

+1 on this as well.

If would be great if this was on the standard 10055 port, if not could you please notify us (Datadog)? 🙇

@jalberto
Copy link

any progress on this?

@NicolaiPetri
Copy link

NicolaiPetri commented Jul 6, 2018

Hi.
I got this partially working on my aks cluster by doing the following:

kubectl edit deployment -n kube-system kube-dns-v20

and then inserted the following setting

        env:
        - name: PROMETHEUS_PORT
          value: "10055"

This makes polling of port 10055 work.

@StianOvrevage
Copy link

@NicolaiPetri s workaround works here. I also added the sidecar container that exposes dnsmasq metrics.

Here is how to apply both workarounds and this makes default prometheus-operator setup to automatically start scraping both metrics. Save the following file as kube-dns-metrics-patch.yaml and run kubectl patch deployment -n kube-system kube-dns-v20 --patch "$(cat kube-dns-metrics-patch.yaml)" to apply the changes.

spec:
  template:
    spec:
      containers:
      - name: kubedns
        env:
        - name: PROMETHEUS_PORT
          value: "10055"
      - name: sidecar
        image: k8s.gcr.io/k8s-dns-sidecar-amd64:1.14.10
        livenessProbe:
          httpGet:
            path: /metrics
            port: 10054
            scheme: HTTP
          initialDelaySeconds: 60
          timeoutSeconds: 5
          successThreshold: 1
          failureThreshold: 5
        args:
        - --v=2
        - --logtostderr
        - --probe=kubedns,127.0.0.1:10053,kubernetes.default.svc.cluster.local
        - --probe=dnsmasq,127.0.0.1:53,kubernetes.default.svc.cluster.local
        ports:
        - containerPort: 10054
          name: metrics
          protocol: TCP
        resources:
          requests:
            memory: 20Mi
            cpu: 10m

@larsduelfer
Copy link

Would be awesome if this is provided out-of-the-box in the future.

@jnoller
Copy link
Contributor

jnoller commented Feb 9, 2019

This was rolled out in the January 2019 releases. Customers who upgrade their cluster to a new version (major/minor/patch) will see that kube-dns/coreDNS both have the autoscaler enabled and DNS metrics are now exposed as well.

@jnoller jnoller closed this as completed Feb 9, 2019
@palmerabollo
Copy link
Contributor

@jnoller I think there is a missing "prometheus.io/scrape" annotation in the coredns deployment (at least with k8s 1.16.x). Should I open a separate issue?

@ghost ghost locked as resolved and limited conversation to collaborators Aug 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

9 participants