Skip to content

feat: Add flagz endpoint for kubelet#128857

Merged
k8s-ci-robot merged 1 commit intokubernetes:masterfrom
zhifei92:flagz-kubelet
Mar 13, 2025
Merged

feat: Add flagz endpoint for kubelet#128857
k8s-ci-robot merged 1 commit intokubernetes:masterfrom
zhifei92:flagz-kubelet

Conversation

@zhifei92
Copy link
Copy Markdown
Contributor

@zhifei92 zhifei92 commented Nov 19, 2024

What type of PR is this?

/kind feature

What this PR does / why we need it:

Adds a /flagz endpoint for kubelet
part of kubernetes/enhancements#4828

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Added a /flagz endpoint for kubelet endpoint

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

KEP : https://github.com/kubernetes/enhancements/blob/master/keps/sig-instrumentation/4828-component-flagz/README.md

kubectl get --raw "/api/v1/nodes/{nodename}/proxy/flagz"

kubelet flags
Warning: This endpoint is not meant to be machine parseable, has no formatting compatibility guarantees and is for debugging purposes only.

address=0.0.0.0
allowed-unsafe-sysctls=[]
anonymous-auth=true
application-metrics-count-limit=100
authentication-token-webhook=false
authentication-token-webhook-cache-ttl=2m0s
authorization-mode=AlwaysAllow
authorization-webhook-cache-authorized-ttl=5m0s
authorization-webhook-cache-unauthorized-ttl=30s
boot-id-file=/proc/sys/kernel/random/boot_id
bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf
cert-dir=/var/lib/kubelet/pki
cgroup-driver=cgroupfs
cgroup-root=
cgroups-per-qos=true
client-ca-file=
cloud-config=
cloud-provider=
cluster-dns=[]
cluster-domain=
config=/var/lib/kubelet/config.yaml
config-dir=
container-hints=/etc/cadvisor/container_hints.json
container-log-max-files=5
container-log-max-size=10Mi
container-runtime-endpoint=unix:///var/run/containerd/containerd.sock
containerd=/run/containerd/containerd.sock
containerd-namespace=k8s.io
contention-profiling=false
cpu-cfs-quota=true
cpu-cfs-quota-period=100ms
cpu-manager-policy=none
cpu-manager-policy-options=
cpu-manager-reconcile-period=10s
enable-controller-attach-detach=true
enable-debugging-handlers=true
enable-load-reader=false
enable-server=true
enforce-node-allocatable=[pods]
event-burst=100
event-qps=50

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. 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/S Denotes a PR that changes 10-29 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. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Nov 19, 2024
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

Hi @zhifei92. 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.

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 area/kubelet kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API sig/node Categorizes an issue or PR as relevant to SIG Node. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Nov 19, 2024
@zhifei92
Copy link
Copy Markdown
Contributor Author

/hold Waiting for PR #128811, which depends on the included componentKubelet.

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 19, 2024
@yongruilin
Copy link
Copy Markdown
Contributor

/sig instrumentation
/cc @yongruilin

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

richabanker commented Nov 27, 2024

Hello @zhifei92 is this PR still WIP?
(Also, thanks for picking this up!)

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Nov 28, 2024
@zhifei92 zhifei92 changed the title [WIP]feat: Add flagz endpoint for kubelet feat: Add flagz endpoint for kubelet Nov 28, 2024
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 28, 2024
@zhifei92
Copy link
Copy Markdown
Contributor Author

Hello @zhifei92 is this PR still WIP?

@richabanker Hi, it is now ready for review.

Comment thread cmd/kubelet/app/server.go Outdated
@richabanker
Copy link
Copy Markdown
Contributor

/ok-to-test

@zhifei92
Copy link
Copy Markdown
Contributor Author

/retest-required

@zhifei92 zhifei92 force-pushed the flagz-kubelet branch 2 times, most recently from 9d01d37 to 92ae41a Compare February 23, 2025 13:32
@zhifei92
Copy link
Copy Markdown
Contributor Author

@tallclair @vinayakankugoyal Are there any other issues?

Copy link
Copy Markdown
Member

@tallclair tallclair left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

Comment thread pkg/kubelet/server/server.go Outdated
tp oteltrace.TracerProvider) {
klog.InfoS("Starting to listen read-only", "address", address, "port", port)
s := NewServer(host, resourceAnalyzer, checkers, nil, nil)
s := NewServer(host, resourceAnalyzer, checkers, flagz, nil, nil)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: you can just pass nil here and drop the function parameter since it's never served by the readonly server.

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

LGTM label has been added.

DetailsGit tree hash: 4e194eeeda1296a4b23f6e46faf7eb6eb58404da

Fix: Move flagz to InstallDebuggingHandlers.

Move flagz  to the lower switch statemen

Fix linter

Drop the function parameter for the read-only server.
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 13, 2025
@k8s-ci-robot k8s-ci-robot requested a review from tallclair March 13, 2025 02:12
@zhifei92
Copy link
Copy Markdown
Contributor Author

zhifei92 commented Mar 13, 2025

/cc @haircommander @SergeyKanzhelev for approve. Please take a look. thx~

@richabanker
Copy link
Copy Markdown
Contributor

/approve

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: richabanker, tallclair, zhifei92

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 Mar 13, 2025
@zhifei92
Copy link
Copy Markdown
Contributor Author

@richabanker @tallclair Need lgtm again.

@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 Mar 13, 2025
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

LGTM label has been added.

DetailsGit tree hash: 1115cbcfaa33fc1bf19f9e2d8cac97e73b18bf37

@zhifei92
Copy link
Copy Markdown
Contributor Author

/unhold

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 13, 2025
@k8s-triage-robot
Copy link
Copy Markdown

This PR may require API review.

If so, when the changes are ready, complete the pre-review checklist and request an API review.

Status of requested reviews is tracked in the API Review project.

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

@zhifei92: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-kubernetes-e2e-kind-ipv6 2db729c link unknown /test pull-kubernetes-e2e-kind-ipv6

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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. I understand the commands that are listed here.

@zhifei92
Copy link
Copy Markdown
Contributor Author

/test pull-kubernetes-e2e-kind-ipv6

@k8s-ci-robot k8s-ci-robot merged commit 953b40b into kubernetes:master Mar 13, 2025
@k8s-ci-robot k8s-ci-robot added this to the v1.33 milestone Mar 13, 2025
@github-project-automation github-project-automation Bot moved this from Work in progress to Done in SIG Node: code and documentation PRs Mar 13, 2025
@liggitt liggitt moved this to API review completed, 1.33 in API Reviews Dec 3, 2025
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/kubelet cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API 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. 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/architecture Categorizes an issue or PR as relevant to SIG Architecture. sig/instrumentation Categorizes an issue or PR as relevant to SIG Instrumentation. sig/node Categorizes an issue or PR as relevant to SIG Node. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.

Projects

Status: API review completed, 1.33

Development

Successfully merging this pull request may close these issues.

7 participants