contour
contour copied to clipboard
Contour supports using different ports for service health check
Please describe the problem you have [A clear, concise, description of the problem you are facing. What is the problem that feature X would solve for you?] I use httpproxy to route to port 8080 of a service, but my health check port is 8998. I checked the relevant documentation of envoy, envoy supports the use of a different port than upstream services for health check,https://www.envoyproxy.io/docs/envoy/v1.23.0/api-v3/config/endpoint/v3/endpoint_components.proto#envoy-v3-api-msg-config-endpoint-v3-endpoint-healthcheckconfig. Can contour support this configuration?
apiVersion: projectcontour.io/v1
kind: HTTPProxy
metadata:
name: example
namespace: contour
spec:
virtualhost:
fqdn: example.com
routes:
- conditions:
- prefix: /test
healthCheckPolicy:
path: /
port: 8998
services:
- name: httpbin
port: 8080
Ah the configuration you point to is a per-endpoint health check configuration, which we don't yet support (we only set up the cluster level healthchecks and not per-endpoint overrides) but possibly could add this, with a few considerations:
- the healthcheck port should be exposed on the app service to ensure Envoy can reach it
- this will have to be a check in the httpproxy processor, to make sure the service exposes the port
- the healthcheck port will need to be saved in the dag cluster, and wired through to the endpoint translator
- should probably also support customizing the port for TCP health check policy as well: https://projectcontour.io/docs/v1.22.0/config/api/#projectcontour.io/v1.TCPHealthCheckPolicy
shouldn't be too involved of a change, we can provide guidance if you or other community members would like to contribute this!
please assign it to me, i will do it well @sunjayBhatia
@yangyy93 are you still interested in working on this?
Sorry, I have been busy with other things recently, I will continue to finish this isser recently
No problem, will leave it assigned to you for now!