contour icon indicating copy to clipboard operation
contour copied to clipboard

Contour supports using different ports for service health check

Open yangyy93 opened this issue 3 years ago • 6 comments

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

yangyy93 avatar Aug 02 '22 02:08 yangyy93

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

sunjayBhatia avatar Aug 04 '22 19:08 sunjayBhatia

shouldn't be too involved of a change, we can provide guidance if you or other community members would like to contribute this!

sunjayBhatia avatar Aug 04 '22 19:08 sunjayBhatia

please assign it to me, i will do it well @sunjayBhatia

yangyy93 avatar Aug 05 '22 10:08 yangyy93

@yangyy93 are you still interested in working on this?

skriss avatar Sep 20 '22 20:09 skriss

Sorry, I have been busy with other things recently, I will continue to finish this isser recently

yangyy93 avatar Sep 21 '22 02:09 yangyy93

No problem, will leave it assigned to you for now!

skriss avatar Sep 21 '22 02:09 skriss