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

Bug 1883196: kube-apiserver: silence own loopback requests before /readyz success #376

Conversation

sttts
Copy link

@sttts sttts commented Sep 28, 2020

No description provided.

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 28, 2020
@sttts sttts changed the title kube-apiserver: silence own loopback requests before /readyz success Bug 1883196: kube-apiserver: silence own loopback requests before /readyz success Sep 28, 2020
@openshift-ci-robot openshift-ci-robot added bugzilla/severity-high Referenced Bugzilla bug's severity is high for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. labels Sep 28, 2020
@openshift-ci-robot
Copy link

@sttts: This pull request references Bugzilla bug 1883196, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.6.0) matches configured target release for branch (4.6.0)
  • bug is in the state NEW, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

Bug 1883196: kube-apiserver: silence own loopback requests before /readyz success

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.

@sttts
Copy link
Author

sttts commented Sep 28, 2020

/retest

1 similar comment
@sttts
Copy link
Author

sttts commented Sep 29, 2020

/retest

@@ -143,3 +145,7 @@ func isLocal(req *http.Request) bool {

return false
}

func isKubeApiserverLoopBack(req *http.Request) bool {
return strings.HasPrefix(req.UserAgent(), "kube-apiserver/")

Choose a reason for hiding this comment

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

is there a variable we could reference instead of a string?

Copy link
Author

Choose a reason for hiding this comment

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

I don't think.

@@ -116,7 +116,9 @@ func WithNonReadyRequestLogging(handler http.Handler, hasBeenReadyCh <-chan stru
// ignore connections to local IP. Those clients better know what they are doing.
if pth := "/" + strings.TrimLeft(r.URL.Path, "/"); pth != "/readyz" && pth != "/healthz" && pth != "/livez" {
if isLocal(r) {
klog.V(2).Infof("Loopback request to %q (user agent %q) before server is ready. This client probably does not watch /readyz and might get inconsistent answers.", r.URL.Path, r.UserAgent())
if !isKubeApiserverLoopBack(r) {

Choose a reason for hiding this comment

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

you could change it to if isLocal(r) && !isKubeApiserverLoopBack(r)

Copy link
Author

Choose a reason for hiding this comment

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

no, then the else case is hit and it shouldn't.

Choose a reason for hiding this comment

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

ah, ic, correct.

@@ -143,3 +145,7 @@ func isLocal(req *http.Request) bool {

return false
}

func isKubeApiserverLoopBack(req *http.Request) bool {

Choose a reason for hiding this comment

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

based on https://gcsweb-ci.apps.ci.l2s4.p1.openshiftapps.com/gcs/origin-ci-test/logs/release-openshift-origin-installer-e2e-remote-libvirt-s390x-4.6/1308979535697416192/artifacts/e2e-remote-libvirt/pods/openshift-kube-apiserver_kube-apiserver-ci-op-tjzfzjcn-486b5-lzwlc-master-1_kube-apiserver.log

at least the following operators are also using loopback:

  • cluster-kube-controller-manager-operator
  • cluster-kube-apiserver-operator

do you know why?
would we like to put them on a white list?

Copy link
Author

Choose a reason for hiding this comment

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

that's a follow-up.

It is the DR sidecar afaik. But before whitelisting that we have to change the user agent there. We do not want to whitelist kcm-o or ka-o as a whole.

@p0lyn0mial
Copy link

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Sep 29, 2020
@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: p0lyn0mial, sttts

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

@openshift-merge-robot openshift-merge-robot merged commit 6ef2098 into openshift:master Sep 29, 2020
@openshift-ci-robot
Copy link

@sttts: All pull requests linked via external trackers have merged:

Bugzilla bug 1883196 has been moved to the MODIFIED state.

In response to this:

Bug 1883196: kube-apiserver: silence own loopback requests before /readyz success

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.

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. bugzilla/severity-high Referenced Bugzilla bug's severity is high for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants