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

Export kubernetes client metrics from dns-controller. #4612

Merged
merged 1 commit into from
Apr 1, 2018

Conversation

tomwilkie
Copy link
Contributor

The metrics from the go-client are super useful when checking all your components can successfully talk to the API server.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Mar 8, 2018
@robinpercy
Copy link
Contributor

/assign
/ok-to-test

@k8s-ci-robot k8s-ci-robot removed the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Mar 12, 2018
@robinpercy
Copy link
Contributor

Thanks for the PR @tomwilkie. Mind rebasing this one when you have a minute?

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 13, 2018
@tomwilkie
Copy link
Contributor Author

Sure, will give it a go!

@tomwilkie tomwilkie force-pushed the dns-controller-metrics branch from d90437d to f8eaeb9 Compare March 14, 2018 09:30
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 14, 2018
@tomwilkie
Copy link
Contributor Author

@robinpercy there you go.

@robinpercy
Copy link
Contributor

/retest

@robinpercy
Copy link
Contributor

Thanks again. I gave it a quick test and all looks good.
/lgtm
/assign @chrislovecnm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 14, 2018
@@ -74,6 +79,11 @@ func main() {
flags.AddGoFlagSet(flag.CommandLine)
flags.Parse(os.Args)

go func() {
http.Handle("/metrics", promhttp.Handler())
Copy link
Contributor

Choose a reason for hiding this comment

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

My only concern is that we have no way to shut this new feature off. That capability adds more complexity to this PR, but it we probably need the capability to control that functionality.

@robinpercy thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

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

@chrislovecnm It's not a particularly invasive feature. But after looking at how we do it elsewhere (eg calico), I think we should expose it and allow it to be disabled via the API, for consistency.

@tomwilkie We could add two variables to the ExternalDNS API, one to toggle the feature, and the other to override the port. It would be similar to how the WatchIngress flag was added in #2504

Let us know if you don't have time to add that in, and maybe we can merge this as-is and do the API stuff in another PR

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah no problem, will do it tomorrow.

and the other to override the port

Port is configurable via -metrics-listen-addr.

Copy link
Contributor

Choose a reason for hiding this comment

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

Great thanks.

Since kops generates the manifest for dns-controller at cluster-build time, we need to add a field for -metrics-listen-addr to the internal model and API in order for users to be able to specify it. Unfortunately, there are a few hoops to jump through :/. Let me know if you have any questions. #2504 is the best example I could find.

@chrislovecnm
Copy link
Contributor

Thanks for the PR. I like this new feature.

@@ -74,6 +79,11 @@ func main() {
flags.AddGoFlagSet(flag.CommandLine)
flags.Parse(os.Args)

go func() {
http.Handle("/metrics", promhttp.Handler())
log.Fatal(http.ListenAndServe(metricsListen, nil))
Copy link
Member

Choose a reason for hiding this comment

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

FYI we typically use glog

@justinsb
Copy link
Member

justinsb commented Apr 1, 2018

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: justinsb, robinpercy, tomwilkie

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 1, 2018
@k8s-ci-robot k8s-ci-robot merged commit f0fcf07 into kubernetes:master Apr 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants