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

Ingress controller does not work with TCP readiness probe, defaults back to HTTP #596

Closed
arianitu opened this issue Jan 7, 2019 · 8 comments

Comments

@arianitu
Copy link

arianitu commented Jan 7, 2019

I want to use a TCP readiness probe, but it keeps creating a HTTP health check instead of a TCP health check. In my deployment of my service, I have this:

        readinessProbe:
          tcpSocket:
            port: 80
            
          initialDelaySeconds: 5
          periodSeconds: 10
          
        livenessProbe:
          tcpSocket:
            port: 80
              
          initialDelaySeconds: 15
          periodSeconds: 20

        ports:
          - containerPort: 80

When I go to the GCE health check tab, it still uses HTTP. Is it because I am using port 80 here?

@rramkumar1
Copy link
Contributor

@arianitu An L7 Google Cloud LB only supports HTTP, HTTPS or HTTP2 health checks.

Is there a specific reason why you need to use a TCP readiness/liveness probe vs a probe that makes a HTTP call?

@arianitu
Copy link
Author

arianitu commented Jan 8, 2019

@rramkumar1 Is that true? Under the LB on Google Cloud, I can pick TCP as an option for a health check.

There isn't a specific reason, I was just using TCP health checks and it was failing even though under LB I can edit the generated LB and switch it to TCP and it works.

@rramkumar1
Copy link
Contributor

rramkumar1 commented Jan 8, 2019

@arianitu Yeah, you are right. I was reading the documentation at https://cloud.google.com/load-balancing/docs/https/ and didn't see TCP so I assumed it was not supported but it looks like it is an option.

Looking at our code, when we look at the liveness/readiness probe from the Pod spec, we only look at HTTP settings (see https://github.com/kubernetes/ingress-gce/blob/master/pkg/controller/translator/translator.go#L229)

We want to deprecate soon the "health checks via probe" feature so I doubt we will add support for looking at the TCP settings. Given that, can this be closed?

@arianitu
Copy link
Author

arianitu commented Jan 8, 2019

@rramkumar1 What do you mean you're going to deprecate health checks via probe? Will you have to manually setup health checks on LB going forward, or you are designing a new system?

@rramkumar1
Copy link
Contributor

@arianitu We will be surfacing a new API in the existing BackendConfig CRD for users to configure health checks. The liveness probe API is not expressive enough and requires us to watch all Pods. It is also very error prone.

Once this new API lands, we will ensure that existing users of the liveness probe health checks have a clear migration story.

@arianitu
Copy link
Author

arianitu commented Jan 8, 2019

Sweet, looking forward to it!

@rramkumar1

@arianitu arianitu closed this as completed Jan 8, 2019
@jgirdner
Copy link

Following the instructions on Google to create a node port service and then ingress. Ingress creates a health check that is checking the node port which is set to TCP but the health check that's created is checking over HTTP. When I change that auto created health check to TCP it passes and the site comes up but it sets itself back to HTTP and I can't seem to figure out why.

@rramkumar1
Copy link
Contributor

@jgirdner It is expected behavior that the ingress-gce controller will overwrite your changes.

Please see #42 for discussion on how to surface an API that allows for custom health checks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants