Skip to content

Lookup ENABLE_CLIENT_GO_WATCH_LIST_ALPHA in NewReflectorWithOptions#118235

Merged
k8s-ci-robot merged 1 commit intokubernetes:masterfrom
kkkkun:set_watchlist_env
May 25, 2023
Merged

Lookup ENABLE_CLIENT_GO_WATCH_LIST_ALPHA in NewReflectorWithOptions#118235
k8s-ci-robot merged 1 commit intokubernetes:masterfrom
kkkkun:set_watchlist_env

Conversation

@kkkkun
Copy link
Copy Markdown
Member

@kkkkun kkkkun commented May 24, 2023

What type of PR is this?

/kind bug

What this PR does / why we need it:

Which issue(s) this PR fixes:

We should change follow codes to NewReflectorWithOptions.

if s := os.Getenv("ENABLE_CLIENT_GO_WATCH_LIST_ALPHA"); len(s) > 0 {
		r.UseWatchList = true
}

Current set in https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/client-go/tools/cache/controller.go#L151. If other do not use controller, it's not work when set ENABLE_CLIENT_GO_WATCH_LIST_ALPHA=true.

we can see follow case request of kubelet when restart

Pods resource still ListWatch when set ENABLE_CLIENT_GO_WATCH_LIST_ALPHA=true, you can see https://github.com/kubernetes/kubernetes/blob/master/pkg/kubelet/config/apiserver.go#L66

I0524 12:53:17.548782       1 httplog.go:132] "HTTP" verb="WATCH" URI="/apis/node.k8s.io/v1/runtimeclasses?allowWatchBookmarks=true&resourceVersion=541776794&timeout=5m2s&timeoutSeconds=302&watch=true" latency="3m2.776282077s" userAgent="kubelet/v1.27.0 (linux/amd64) kubernetes/b8e3718" audit-ID="978592e0-f6c1-4895-b498-06d2153a1134" srcIP="x.x.x.x:x" apf_pl="system" apf_fs="system-nodes" apf_iseats=1 apf_fseats=0 apf_additionalLatency="0s" apf_init_latency="212.878µs" apf_execution_time="213.777µs" resp=200
I0524 12:53:17.548803       1 httplog.go:132] "HTTP" verb="WATCH" URI="/api/v1/nodes?allowWatchBookmarks=true&fieldSelector=metadata.name%3Dnode-1&resourceVersion=541708492&timeout=7m10s&timeoutSeconds=430&watch=true" latency="5m48.788466921s" userAgent="kubelet/v1.27.0 (linux/amd64) kubernetes/b8e3718" audit-ID="ac1a48b5-a030-4e8d-bce5-703f6b50fd59" srcIP="x.x.x.x:x" apf_pl="node-high" apf_fs="system-node-high" apf_iseats=1 apf_fseats=0 apf_additionalLatency="0s" apf_init_latency="323.669µs" apf_execution_time="325.137µs" resp=200
I0524 12:53:17.548792       1 httplog.go:132] "HTTP" verb="WATCH" URI="/api/v1/services?allowWatchBookmarks=true&resourceVersion=541487296&timeout=7m53s&timeoutSeconds=473&watch=true" latency="6m26.790128209s" userAgent="kubelet/v1.27.0 (linux/amd64) kubernetes/b8e3718" audit-ID="f3bd04d4-0687-42ef-a392-3e7b7a87db12" srcIP="x.x.x.x:x" apf_pl="system" apf_fs="system-nodes" apf_iseats=1 apf_fseats=0 apf_additionalLatency="0s" apf_init_latency="171.517µs" apf_execution_time="173.588µs" resp=200
I0524 12:53:17.548810       1 httplog.go:132] "HTTP" verb="WATCH" URI="/api/v1/pods?allowWatchBookmarks=true&fieldSelector=spec.nodeName%3Dnode-1&resourceVersion=541596718&timeoutSeconds=571&watch=true" latency="6m32.78753062s" userAgent="kubelet/v1.27.0 (linux/amd64) kubernetes/b8e3718" audit-ID="10b84bc5-0ae1-450a-9771-aa0c5554a3d9" srcIP="x.x.x.x:x" apf_pl="system" apf_fs="system-nodes" apf_iseats=1 apf_fseats=0 apf_additionalLatency="0s" apf_init_latency="243.261µs" apf_execution_time="244.065µs" resp=200
I0524 12:53:17.548831       1 httplog.go:132] "HTTP" verb="WATCH" URI="/apis/storage.k8s.io/v1/csidrivers?allowWatchBookmarks=true&resourceVersion=541601628&timeout=9m51s&timeoutSeconds=591&watch=true" latency="5m36.787954314s" userAgent="kubelet/v1.27.0 (linux/amd64) kubernetes/b8e3718" audit-ID="d157ef07-2730-47e1-bc0a-4bd8f2f77338" srcIP="x.x.x.x:x" apf_pl="system" apf_fs="system-nodes" apf_iseats=1 apf_fseats=0 apf_additionalLatency="0s" apf_init_latency="238.001µs" apf_execution_time="239.784µs" resp=200
I0524 12:53:18.630986       1 httplog.go:132] "HTTP" verb="LIST" URI="/api/v1/pods?fieldSelector=spec.nodeName%3Dnode-1&limit=500&resourceVersion=0" latency="1.204271ms" userAgent="kubelet/v1.27.0 (linux/amd64) kubernetes/b8e3718" audit-ID="0a0005c4-cbd9-4d3d-839e-523166a83e30" srcIP="x.x.x.x:x" apf_pl="system" apf_fs="system-nodes" apf_iseats=10 apf_fseats=0 apf_additionalLatency="0s" apf_execution_time="482.124µs" resp=200

Special notes for your reviewer:

Does this PR introduce a user-facing change?


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


Signed-off-by: kkkkun <scuzk373x@gmail.com>
@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. 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. labels May 24, 2023
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

Hi @kkkkun. 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/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the needs-priority Indicates a PR lacks a `priority/foo` label and requires one. label May 24, 2023
@k8s-ci-robot k8s-ci-robot requested review from ncdc and wojtek-t May 24, 2023 13:24
@k8s-ci-robot k8s-ci-robot added sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels May 24, 2023
@kkkkun
Copy link
Copy Markdown
Member Author

kkkkun commented May 24, 2023

/release-note-none

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. 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 May 24, 2023
@kkkkun
Copy link
Copy Markdown
Member Author

kkkkun commented May 24, 2023

/assign @p0lyn0mial @wojtek-t

@p0lyn0mial
Copy link
Copy Markdown
Contributor

oh, a great find. I like it because it will give us more opportunities to test the feature.

In the future we should probably export the WatchList field as an option.

@p0lyn0mial
Copy link
Copy Markdown
Contributor

/ok-to-test
/test pull-kubernetes-e2e-gce-cos-alpha-features

@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 May 25, 2023
@p0lyn0mial
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 May 25, 2023
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

LGTM label has been added.

DetailsGit tree hash: c1b45b49a4b74152c819bf0854445fc9b983e787

@p0lyn0mial
Copy link
Copy Markdown
Contributor

/assign @wojtek-t for approval

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

@p0lyn0mial: GitHub didn't allow me to assign the following users: for, approval.

Note that only kubernetes members with read permissions, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time.
For more information please see the contributor guide

Details

In response to this:

/assign @wojtek-t for approval

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.

@wojtek-t
Copy link
Copy Markdown
Member

/lgtm
/approve

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kkkkun, wojtek-t

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 May 25, 2023
@kkkkun
Copy link
Copy Markdown
Member Author

kkkkun commented May 25, 2023

/test pull-kubernetes-e2e-kind-ipv6

@k8s-ci-robot k8s-ci-robot merged commit 6911d3b into kubernetes:master May 25, 2023
@k8s-ci-robot k8s-ci-robot added this to the v1.28 milestone May 25, 2023
@kkkkun
Copy link
Copy Markdown
Member Author

kkkkun commented May 25, 2023

Should we cherry-pick to 1.27 @p0lyn0mial @wojtek-t ?

@p0lyn0mial
Copy link
Copy Markdown
Contributor

Should we cherry-pick to 1.27 @p0lyn0mial @wojtek-t ?

I don't think it is necessary since this is an alpha feature.

@cici37
Copy link
Copy Markdown
Contributor

cici37 commented May 30, 2023

/triage accepted

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels May 30, 2023
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-none Denotes a PR that doesn't merit a release note. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants