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

fix runtime image probe handler setup #963

Merged
merged 1 commit into from
Apr 10, 2024

Conversation

dprotaso
Copy link
Member

@dprotaso dprotaso commented Apr 10, 2024

While working on knative-extensions/net-gateway-api#18

I discovered the runtime image in this repository doesn't behave like the queue proxy. The probe handler should work with any URL path but this image it only works when the path is /healthz

The change in the PR changes the handler setup so the probe handler is first. This is what the other networking images do.

/assign @izabelacg

Copy link

knative-prow bot commented Apr 10, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dprotaso

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 approved Indicates a PR has been approved by an approver from all required OWNERS files. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Apr 10, 2024
@dprotaso
Copy link
Member Author

cc @ReToCode @skonto

@dprotaso dprotaso changed the title this fixes the probe handler to reflect that it doesn't care about the path fix runtime image probe handler setup Apr 10, 2024
@izabelacg
Copy link
Member

can you share how to reproduce the issue? I curled the service (original) in different paths with the user-agent header and seems to work as expected. I get the following:

$ curl http://runtime-test-image.default.svc.cluster.local -H "User-Agent: kube-probe/1.25" -v
* Host runtime-test-image.default.svc.cluster.local:80 was resolved.r-Agent: kube-probe/1.25" -v
...
* Connected to runtime-test-image.default.svc.cluster.local (10.96.102.30) port 80
> GET / HTTP/1.1
> Host: runtime-test-image.default.svc.cluster.local
> Accept: */*
> User-Agent: kube-probe/1.25
> 
* Request completely sent off
< HTTP/1.1 200 OK
< date: Wed, 10 Apr 2024 18:08:21 GMT
< content-length: 0
< x-envoy-upstream-service-time: 0
< server: envoy
< 
* Connection #0 to host runtime-test-image.default.svc.cluster.local left intact

@dprotaso
Copy link
Member Author

When you curl with the probe header it should always return the hash

eg.

curl -vv -H"K-Network-Hash: some-hash" -H"K-Network-Probe: probe" localhost:8080/healthz

Should also work when you are not using the /healthz path

curl -vv -H"K-Network-Hash: some-hash" -H"K-Network-Probe: probe" localhost:8080

@dprotaso
Copy link
Member Author

If you're running this image with Knative Service then you won't reproduce original issue

These pods don't run with the queue proxy sidecar in the conformance tests - so it's replicating that.

@izabelacg
Copy link
Member

Thanks for the explanation. I got to see the issue and solution working.

@izabelacg
Copy link
Member

/lgtm

@knative-prow knative-prow bot added the lgtm Indicates that a PR is ready to be merged. label Apr 10, 2024
@knative-prow knative-prow bot merged commit 2a4859c into knative:main Apr 10, 2024
26 checks passed
@dprotaso dprotaso deleted the fix-runtime-image branch April 10, 2024 19:30
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