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

Drop special logic for kubelet probe header for istio #950

Merged
merged 4 commits into from
Mar 26, 2024

Conversation

izabelacg
Copy link
Member

Changes

  • Deprecates k-kubelet-probe header

Part of knative/serving#14981

@knative-prow knative-prow bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 25, 2024
@knative-prow knative-prow bot requested review from ReToCode and skonto March 25, 2024 17:56
Copy link

codecov bot commented Mar 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.43%. Comparing base (1aa1ec2) to head (a3cb1e5).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #950   +/-   ##
=======================================
  Coverage   93.43%   93.43%           
=======================================
  Files          36       36           
  Lines        1249     1249           
=======================================
  Hits         1167     1167           
  Misses         69       69           
  Partials       13       13           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@izabelacg
Copy link
Member Author

/retest

@izabelacg
Copy link
Member Author

The downstream test TestIgnoreProbe fails since it is setting k-kubelet-probe to signal a kubelet probe, however the logic to determine a kubelet probe is now different and no longer checks for the custom header.

@izabelacg izabelacg changed the title [WIP] Drop special logic for kubelet probe header for istio Drop special logic for kubelet probe header for istio Mar 25, 2024
@knative-prow knative-prow bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 25, 2024
@izabelacg izabelacg changed the title Drop special logic for kubelet probe header for istio [WIP] Drop special logic for kubelet probe header for istio Mar 25, 2024
@knative-prow knative-prow bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 25, 2024
@izabelacg izabelacg changed the title [WIP] Drop special logic for kubelet probe header for istio Drop special logic for kubelet probe header for istio Mar 25, 2024
@knative-prow knative-prow bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 25, 2024
@dprotaso
Copy link
Member

These constants are used in knative/pkg - we do not want to deprecate them

see: knative/pkg#2997 (comment)

@dprotaso dprotaso closed this Mar 26, 2024
@dprotaso dprotaso reopened this Mar 26, 2024
@dprotaso
Copy link
Member

Whoops my bad - for some reason I thought K-Kubelet-Probe was a K8s thing - but they just use User-Agent with the kube-probe/ prefix

Comment on lines 72 to 77
// KubeletProbeKey is the name of the header supplied by kubelet
// probes. Istio with mTLS rewrites probes, but their probes pass a
// different user-agent. So we augment the probes with this header.
//
// Deprecated: use knative.dev/networking/pkg/http/header.UserAgentKey
KubeletProbeKey = header.UserAgentKey
Copy link
Member

Choose a reason for hiding this comment

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

Drop this addtion - we don't need to introduce a new field here

Comment on lines 69 to 70
// Deprecated: use knative.dev/networking/pkg/http/header.UserAgentKey
KubeletProbeHeaderName = header.UserAgentKey
Copy link
Member

Choose a reason for hiding this comment

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

I'd leave this referencing header.KubeletProbeKey as before

@@ -58,6 +58,8 @@ const (
// KubeletProbeKey is the name of the header supplied by kubelet
// probes. Istio with mTLS rewrites probes, but their probes pass a
// different user-agent. So we augment the probes with this header.
//
// Deprecated: use knative.dev/networking/pkg/http/header.UserAgentKey
Copy link
Member

Choose a reason for hiding this comment

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

I'd be more specific in this deprecation notice and say we want to detect probes with header.UserAgentKey and KubeProbeUAPrefix

Copy link
Member Author

Choose a reason for hiding this comment

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

Made changes. Let me know if the text makes sense

Comment on lines 130 to 131
func IsKubeletProbe(r *http.Request) bool {
return strings.HasPrefix(r.Header.Get("User-Agent"), KubeProbeUAPrefix) ||
r.Header.Get(KubeletProbeKey) != ""
return strings.HasPrefix(r.Header.Get("User-Agent"), KubeProbeUAPrefix)
Copy link
Member

Choose a reason for hiding this comment

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

I think we should leave this as is for now and then remove the use of K-Kubelet-Probe after a release or two

Copy link
Member

Choose a reason for hiding this comment

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

if there's a minor drift between the queue proxy and the deployment then we want to prevent things from blowing up.

@dprotaso
Copy link
Member

/lgtm
/approve

@knative-prow knative-prow bot added the lgtm Indicates that a PR is ready to be merged. label Mar 26, 2024
Copy link

knative-prow bot commented Mar 26, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dprotaso, izabelacg

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

@knative-prow knative-prow bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 26, 2024
@knative-prow knative-prow bot merged commit 419ebf9 into knative:main Mar 26, 2024
27 checks passed
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. lgtm Indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants