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
Bug 1883196: kube-apiserver: silence own loopback requests before /readyz success #376
Conversation
@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
In response to this:
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. |
/retest |
1 similar comment
/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/") |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?
There was a problem hiding this comment.
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.
/lgtm |
[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 |
@sttts: All pull requests linked via external trackers have merged: Bugzilla bug 1883196 has been moved to the MODIFIED state. In response to this:
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. |
No description provided.