Skip to content

feat: Add flagz endpoint for kube-proxy#128985

Merged
k8s-ci-robot merged 1 commit intokubernetes:masterfrom
yongruilin:flagz-kube-proxy
Dec 12, 2024
Merged

feat: Add flagz endpoint for kube-proxy#128985
k8s-ci-robot merged 1 commit intokubernetes:masterfrom
yongruilin:flagz-kube-proxy

Conversation

@yongruilin
Copy link
Copy Markdown
Contributor

@yongruilin yongruilin commented Nov 26, 2024

What type of PR is this?

/kind feature

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #128984 and kubernetes/enhancements#4828

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Added a `/flagz` endpoint for kube-proxy

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

Example response:

curl http://localhost:10249/flagz
kube-proxy flags
Warning: This endpoint is not meant to be machine parseable, has no formatting compatibility guarantees and is for debugging purposes only.

bind-address=0.0.0.0
bind-address-hard-fail=false
boot-id-file=/proc/sys/kernel/random/boot_id
cleanup=false
cluster-cidr=
config=/var/lib/kube-proxy/config.conf
config-sync-period=15m0s
conntrack-max-per-core=32768
conntrack-min=131072
conntrack-tcp-be-liberal=false
conntrack-tcp-timeout-close-wait=1h0m0s
conntrack-tcp-timeout-established=24h0m0s
conntrack-udp-timeout=0s
conntrack-udp-timeout-stream=0s
- [KEP] : https://github.com/kubernetes/enhancements/blob/master/keps/sig-instrumentation/4828-component-flagz/README.md

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/feature Categorizes issue or PR as related to a new feature. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Nov 26, 2024
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

This issue is currently awaiting triage.

If a SIG or subproject determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Details

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-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added needs-priority Indicates a PR lacks a `priority/foo` label and requires one. area/kube-proxy sig/network Categorizes an issue or PR as relevant to SIG Network. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Nov 26, 2024
@yongruilin
Copy link
Copy Markdown
Contributor Author

/sig instrumentation

@k8s-ci-robot k8s-ci-robot added the sig/instrumentation Categorizes an issue or PR as relevant to SIG Instrumentation. label Nov 26, 2024
@aojea
Copy link
Copy Markdown
Member

aojea commented Nov 26, 2024

For context @danwinship I talked offline with the author and in kube-proxy we found three options:

  • use healthz bind address, but I'm afraid this used for lb healthchecks and we have this dual vs single work that I suggested not to use
  • use metrics bind address, the metrics endpoint seems a more stable endpoint to get information of the component
  • bind in a new address, we already have enough problems with two addresses :)

/assign @danwinship
LGTM but waiting for Dan opinion

@Henrywu573
Copy link
Copy Markdown
Contributor

cc @Henrywu573

@danwinship
Copy link
Copy Markdown
Contributor

Is there not a standard for this in other components?
ISTM that it should use the metrics IP, because the information is similarly low-level / debug-ish / potentially-sensitive, as compared to the healthz info.

@yongruilin
Copy link
Copy Markdown
Contributor Author

@danwinship Thanks for the comment. There are PRs created for other components. I'm also using metrics' IP there.

@sftim
Copy link
Copy Markdown
Contributor

sftim commented Dec 10, 2024

/release-note-edit

Added a `/flagz` endpoint for kube-proxy

@richabanker
Copy link
Copy Markdown
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 11, 2024
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

LGTM label has been added.

DetailsGit tree hash: 3ce5fe93157743d31a0a260a619d4cbac3966813

@yongruilin
Copy link
Copy Markdown
Contributor Author

/retest

Comment thread cmd/kube-proxy/app/server.go Outdated
if flagzReader != nil {
s.flagz = flagzReader
}
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You don't need to check the feature gate here; flagzReader can only have been set if the feature gate is enabled.

(So you don't even need this as a separate section; you can just unconditionally set flags: flagzReader in the initial creation of the ProxyServer at the top of the function)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated. thanks!

Comment thread cmd/kube-proxy/app/server.go Outdated

if utilfeature.DefaultFeatureGate.Enabled(zpagesfeatures.ComponentFlagz) {
if flagzReader != nil {
flagz.Install(proxyMux, "kube-proxy", flagzReader)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

likewise, you don't need to check the feature gate here (though in this case you do still need the nil check)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated.

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 11, 2024
@danwinship
Copy link
Copy Markdown
Contributor

/lgtm
/approve
thanks!

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 11, 2024
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

LGTM label has been added.

DetailsGit tree hash: 4e0cdd553b6406635880fefb583b1f80d94fb537

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: danwinship, yongruilin

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

The pull request process is described here

Details 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 Dec 11, 2024
@k8s-ci-robot k8s-ci-robot merged commit a19c27d into kubernetes:master Dec 12, 2024
@k8s-ci-robot k8s-ci-robot added this to the v1.33 milestone Dec 12, 2024
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. area/kube-proxy cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. 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. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/instrumentation Categorizes an issue or PR as relevant to SIG Instrumentation. sig/network Categorizes an issue or PR as relevant to SIG Network. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add flagz endpoint for kube-proxy

7 participants