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

Add metrics-port to kube-proxy cmd flags. #72682

Merged
merged 1 commit into from
Jan 11, 2019

Conversation

whypro
Copy link
Contributor

@whypro whypro commented Jan 8, 2019

What type of PR is this?

Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespaces from that line:

/kind bug

What this PR does / why we need it:

Problems:

  • --healthz-bind-address doesn't support IP+port (just support IP), but description says IP address and port
  • so does --metrics-bind-address
  • we cannot specify metrics server port by cmd flags

Ref: #62582 (Thanks to @xiangpengzhao )

Add metrics-port to make two flag patterns (healthz server address and metrics server address) be consistent. Although these flags of kube-proxy is deprecated , we need to fix it because it still confuses some users.

To enable the metrics server of kube-proxy by cmd flags, we can use:

kube-proxy --metrics-bind-address=0.0.0.0 --metrics-port=10249

Which issue(s) this PR fixes:

Fixes #62479

Special notes for your reviewer:

cc @xiangpengzhao @thockin

Does this PR introduce a user-facing change?:

Add `metrics-port` to kube-proxy cmd flags.

@k8s-ci-robot k8s-ci-robot added do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. kind/bug Categorizes issue or PR as related to a bug. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Jan 8, 2019
@k8s-ci-robot
Copy link
Contributor

Hi @whypro. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jan 8, 2019
@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Jan 8, 2019
@cofyc
Copy link
Member

cofyc commented Jan 8, 2019

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jan 8, 2019
@MrHohn
Copy link
Member

MrHohn commented Jan 8, 2019

@whypro Thanks for picking this up! Will take a look soon. Hopefully we can fix it for real this time.

/sig network
/assign

@k8s-ci-robot k8s-ci-robot added sig/network Categorizes an issue or PR as relevant to SIG Network. lgtm "Looks good to me", indicates that a PR is ready to be merged. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Jan 8, 2019
Copy link
Member

@MrHohn MrHohn left a comment

Choose a reason for hiding this comment

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

/lgtm
Tested locally and seems to work. Thanks for the fix.

@MrHohn
Copy link
Member

MrHohn commented Jan 10, 2019

/assign @thockin
for approval.

@@ -306,6 +311,20 @@ func (o *Options) applyDeprecatedHealthzPortToConfig() {
o.config.HealthzBindAddress = fmt.Sprintf("%s:%d", o.config.HealthzBindAddress, o.healthzPort)
}

func (o *Options) applyDeprecatedMetricsPortToConfig() {
if o.metricsPort == 0 {
Copy link
Member

Choose a reason for hiding this comment

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

I don't understand this. It's a new flag, so the default will be 0. In that case we nuke the user's requested MetricsBindAddress ? Or is the default not 0?

Copy link
Member

Choose a reason for hiding this comment

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

The default is set to ports.ProxyStatusPort, which should be the same as before (10249).

Copy link
Member

Choose a reason for hiding this comment

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

where is that defaulted?

Copy link
Member

Choose a reason for hiding this comment

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

I see it now. Thanks!

@thockin
Copy link
Member

thockin commented Jan 11, 2019

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: MrHohn, thockin, whypro

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 Jan 11, 2019
@k8s-ci-robot k8s-ci-robot merged commit d313c3b into kubernetes:master Jan 11, 2019
k8s-ci-robot added a commit that referenced this pull request Feb 20, 2019
…-upstream-release-1.12

Automated cherry pick of #72682: Add `metrics-port` to kube-proxy cmd flags.
k8s-ci-robot added a commit that referenced this pull request Feb 21, 2019
…-upstream-release-1.13

Automated cherry pick of #72682: Add `metrics-port` to kube-proxy cmd flags.
k8s-ci-robot added a commit that referenced this pull request Mar 2, 2019
…-upstream-release-1.11

Automated cherry pick of #72682: Add `metrics-port` to kube-proxy cmd flags.
mm4tt added a commit to mm4tt/test-infra that referenced this pull request Mar 13, 2019
This PR is essentially reverting
kubernetes#11313. The underlying
issue has been fixed in
kubernetes/kubernetes#72682 and cherrypicked
recently.

Ref. kubernetes/kubernetes#75322
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. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/network Categorizes an issue or PR as relevant to SIG Network. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Conflict validation on kubeproxyconfig.HealthzBindAddress/MetricsBindAddress and flags
5 participants