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 1880941: kube-apiserver: log non-probe requests before ready #356

Merged

Conversation

sttts
Copy link

@sttts sttts commented Sep 15, 2020

Log and create NonReadyRequests event.

@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 15, 2020
// 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). This client probably does not watch /readyz and might get inconsistent answers.", r.URL.Path, r.UserAgent())

Choose a reason for hiding this comment

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

why not as klog.Warningf ?

Copy link
Author

Choose a reason for hiding this comment

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

copy & paste. But I agree.

Copy link
Author

Choose a reason for hiding this comment

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

Actually, no. V(2).Info is just right. We still have few clients that make use of this (disaster recovery for example). It's not a warning, just an info.

@sttts sttts changed the title kube-apiserver: reject non-probe requests before ready kube-apiserver: log non-probe requests before ready Sep 15, 2020
@sttts sttts force-pushed the sttts-reject-before-ready branch 3 times, most recently from 5ec3d27 to 1962108 Compare September 15, 2020 11:25
@@ -275,6 +284,7 @@ func TestAuthenticationAuditAnnotationsDefaultChain(t *testing.T) {
RequestInfoResolver: &request.RequestInfoFactory{},
RequestTimeout: 10 * time.Second,
LongRunningFunc: func(_ *http.Request, _ *request.RequestInfo) bool { return false },
Serializer: serializer.NewCodecFactory(scheme),

Choose a reason for hiding this comment

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

not needed anymore?

@@ -100,3 +91,45 @@ func WithLateConnectionFilter(handler http.Handler) http.Handler {
handler.ServeHTTP(w, r)
})
}

// WithNonReadyRequestLogging rejects the request until the process has been ready once.
func WithNonReadyRequestLogging(handler http.Handler, hasBeenReadyCh <-chan struct{}, s runtime.NegotiatedSerializer) http.Handler {
Copy link

Choose a reason for hiding this comment

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

s runtime.NegotiatedSerializer not used ?

Copy link
Author

Choose a reason for hiding this comment

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

not anymore

@sttts sttts force-pushed the sttts-reject-before-ready branch 2 times, most recently from 028da8a to 395964f Compare September 15, 2020 13:50
@sttts
Copy link
Author

sttts commented Sep 17, 2020

/retest

@sttts sttts force-pushed the sttts-reject-before-ready branch 3 times, most recently from 0bf1538 to 31e7ad4 Compare September 17, 2020 07:08
@sttts
Copy link
Author

sttts commented Sep 17, 2020

/retest

@sttts
Copy link
Author

sttts commented Sep 17, 2020

Broken base images 😞

@sttts
Copy link
Author

sttts commented Sep 18, 2020

/retest

1 similar comment
@sttts
Copy link
Author

sttts commented Sep 19, 2020

/retest

@p0lyn0mial
Copy link

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Sep 21, 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

@sttts sttts changed the title kube-apiserver: log non-probe requests before ready Bug 1880941: kube-apiserver: log non-probe requests before ready Sep 21, 2020
@openshift-ci-robot openshift-ci-robot added bugzilla/severity-medium Referenced Bugzilla bug's severity is medium 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 21, 2020
@openshift-ci-robot
Copy link

@sttts: This pull request references Bugzilla bug 1880941, 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 1880941: kube-apiserver: log non-probe requests before ready

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.

@openshift-bot
Copy link

/retest

Please review the full test history for this PR and help us cut down flakes.

1 similar comment
@openshift-bot
Copy link

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit e0a30f6 into openshift:master Sep 21, 2020
@openshift-ci-robot
Copy link

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

The following pull requests linked via external trackers have not merged:

These pull request must merge or be unlinked from the Bugzilla bug in order for it to move to the next state.

Bugzilla bug 1880941 has not been moved to the MODIFIED state.

In response to this:

Bug 1880941: kube-apiserver: log non-probe requests before ready

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-medium Referenced Bugzilla bug's severity is medium 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

5 participants