Skip to content

feat: Add flagz endpoint for kube-scheduler#128818

Merged
k8s-ci-robot merged 2 commits intokubernetes:masterfrom
yongruilin:flagz-kube-scheduler
Dec 20, 2024
Merged

feat: Add flagz endpoint for kube-scheduler#128818
k8s-ci-robot merged 2 commits intokubernetes:masterfrom
yongruilin:flagz-kube-scheduler

Conversation

@yongruilin
Copy link
Copy Markdown
Contributor

@yongruilin yongruilin commented Nov 15, 2024

What type of PR is this?

/kind feature

What this PR does / why we need it:

Adds a /flagz endpoint for kube-scheduler

Which issue(s) this PR fixes:

Fixes #128816 and kubernetes/enhancements#4828

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Adds a /flagz endpoint for kube-scheduler endpoint

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

Example response

~ curl -k --cert /etc/kubernetes/pki/apiserver-kubelet-client.crt --key /etc/kubernetes/pki/apiserver-kubelet-client.key https://localhost:10259/flagz
kube-scheduler flags
Warning: This endpoint is not meant to be machine parseable, has no formatting compatibility guarantees and is for debugging purposes only.

allow-metric-labels []
allow-metric-labels-manifest
authentication-kubeconfig /etc/kubernetes/scheduler.conf
authentication-skip-lookup false
authentication-token-webhook-cache-ttl 10s
authentication-tolerate-lookup-failure true
authorization-always-allow-paths [/healthz,/readyz,/livez]
authorization-kubeconfig /etc/kubernetes/scheduler.conf
authorization-webhook-cache-authorized-ttl 10s
authorization-webhook-cache-unauthorized-ttl 10s
bind-address 127.0.0.1
cert-dir
client-ca-file
config
contention-profiling true
disable-http2-serving false
disabled-metrics []
emulated-version []
feature-gates :ComponentFlagz=true
help false
http2-max-streams-per-connection 0
kube-api-burst 100
kube-api-content-type application/vnd.kubernetes.protobuf
kube-api-qps 50
kubeconfig /etc/kubernetes/scheduler.conf
leader-elect true
leader-elect-lease-duration 15s
leader-elect-renew-deadline 10s
leader-elect-resource-lock leases
leader-elect-resource-name kube-scheduler
leader-elect-resource-namespace kube-system
leader-elect-retry-period 2s
log-flush-frequency 5s
log-json-info-buffer-size 0
log-json-split-stream false
log-text-info-buffer-size 0
log-text-split-stream false
logging-format text
master
permit-address-sharing false
permit-port-sharing false
pod-max-in-unschedulable-pods-duration 5m0s
profiling true
requestheader-allowed-names []
requestheader-client-ca-file
requestheader-extra-headers-prefix [x-remote-extra-]
requestheader-group-headers [x-remote-group]
requestheader-uid-headers []
requestheader-username-headers [x-remote-user]
secure-port 10259
show-hidden-metrics-for-version
tls-cert-file
tls-cipher-suites []
tls-min-version
tls-private-key-file
tls-sni-cert-key []
v 0
version false
vmodule
write-config-to
[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. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. kind/feature Categorizes issue or PR as related to a new feature. 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 15, 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 the needs-priority Indicates a PR lacks a `priority/foo` label and requires one. label Nov 15, 2024
@k8s-ci-robot k8s-ci-robot added 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/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Nov 15, 2024
@yongruilin
Copy link
Copy Markdown
Contributor Author

/ok-to-test

@k8s-ci-robot k8s-ci-robot added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label Nov 15, 2024
@yongruilin yongruilin force-pushed the flagz-kube-scheduler branch 2 times, most recently from 4b69d51 to aeeda59 Compare November 15, 2024 22:39
Comment thread cmd/kube-scheduler/app/options/options.go Outdated
@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 18, 2024
@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 Nov 19, 2024
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

LGTM label has been added.

DetailsGit tree hash: 4cdfbd47b7350baa0023d623d9f4a21a9387f6d6

@dom4ha
Copy link
Copy Markdown
Member

dom4ha commented Dec 6, 2024

/assign dom4ha

Copy link
Copy Markdown
Member

@kerthcet kerthcet left a comment

Choose a reason for hiding this comment

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

We need a test to make sure flagz works, see similar ones here: test/integration/scheduler/serving/healthcheck_test.go

)

const (
kubeScheduler = "kube-scheduler"
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.

Can you replace L94 with this variable, other places as well. Thanks.

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.

For line 94, I prefer to let it explicitly show the command usage. I've updated the rest of places.

Comment thread cmd/kube-scheduler/app/options/options.go Outdated
Comment thread cmd/kube-scheduler/app/server.go Outdated
Comment thread staging/src/k8s.io/component-base/zpages/flagz/flagreader.go
@kerthcet
Copy link
Copy Markdown
Member

We need a test to make sure flagz works, see similar ones here: test/integration/scheduler/serving/healthcheck_test.go

We need one more test to make sure it works. @yongruilin Thanks

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. area/test sig/testing Categorizes an issue or PR as relevant to SIG Testing. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Dec 18, 2024
@yongruilin
Copy link
Copy Markdown
Contributor Author

@kerthcet thanks for the review, I've added the integration test for flagz endpoint. Follow the same pattern in #128848

Comment thread test/integration/scheduler/serving/flagz_test.go Outdated
Comment thread cmd/kube-scheduler/app/server.go Outdated
Comment thread test/integration/scheduler/serving/flagz_test.go Outdated
@yongruilin yongruilin force-pushed the flagz-kube-scheduler branch 2 times, most recently from 6ee4bbf to 1236c36 Compare December 19, 2024 22:17
@yongruilin
Copy link
Copy Markdown
Contributor Author

/retest

Copy link
Copy Markdown
Member

@kerthcet kerthcet left a comment

Choose a reason for hiding this comment

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

Leave the final LGTM to @dom4ha and please squash, thanks for your patience and efforts.

/approve

@yongruilin
Copy link
Copy Markdown
Contributor Author

/retest

@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 20, 2024
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

LGTM label has been added.

DetailsGit tree hash: 170f30de9ea141fb49c65b97da7c6f48b3dfe5c4

@dom4ha
Copy link
Copy Markdown
Member

dom4ha commented Dec 20, 2024

/lgtm
It looks great now, thanks.

@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: kerthcet, richabanker, 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 20, 2024
@k8s-ci-robot k8s-ci-robot merged commit 438bc5d into kubernetes:master Dec 20, 2024
@k8s-ci-robot k8s-ci-robot added this to the v1.33 milestone Dec 20, 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/test 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. 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/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add flagz endpoint for kube-scheduler

6 participants