Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Configure kube-dns to expose metrics #2566

Merged
merged 1 commit into from
Jun 14, 2018
Merged

Conversation

sylr
Copy link
Contributor

@sylr sylr commented Mar 30, 2018

No description provided.

@jackfrancis
Copy link
Member

@lachie83 Can you kindly take a look at this and weigh in?

Copy link
Member

@jackfrancis jackfrancis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm pending E2E

@@ -47,6 +47,8 @@ spec:
metadata:
annotations:
scheduler.alpha.kubernetes.io/critical-pod: ""
prometheus.io/scrape: "true"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should these annotations be on the service rather than the deployment?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Each pods has its own set of stats so Prometheus should scrape each pods, not the service.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the recommended approach is to annotate the service (though I cannot find a black and white statement from the team about it now). The pods of the service will still get scraped if using a role of endpoints in the kubernetes_sd_configs.
The exposed metrics will be the same either way, but there are a bunch of extra labels available this way.

Also, do note that this annotation is not really standardized, even if it is common in examples. We do not use it at all, and rather use ServiceMonitors from the prometheus-operator. But perhaps it is a reasonable default to ship anyway? Is it set on other kube* things with metrics in acs-engine?

@@ -78,6 +80,9 @@ spec:
- "--dns-port=10053"
- "--v=2"
- "--config-dir=/kube-dns-config"
env:
- name: PROMETHEUS_PORT
value: "10055"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this port fixed? Can you please point me at the docs for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not fixed, we could define any port not already used but that's what they use in kubernetes example:

https://github.com/kubernetes/kubernetes/blob/master/cluster/addons/dns/kube-dns.yaml.base#L132-L134

@jackfrancis
Copy link
Member

@lachie83 based on @sylr's responses are there any outstanding items in this PR?

@mwieczorek
Copy link

@lachie83 can we move this PR further? I'm also interested in getting metrics from kube-dns

@sylr
Copy link
Contributor Author

sylr commented Jun 13, 2018

@jackfrancis can we merge this please ?

@jackfrancis
Copy link
Member

/approve
/lgtm

@acs-bot
Copy link

acs-bot commented Jun 14, 2018

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jackfrancis, sylr

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants