How to verify certificates for Liveness probe configured to https?

6/30/2020

I'm using readinessProbe on my container and configured it work on HTTPS with scheme attribute. My server expects the get the certificates. how can I configure the readiness probe to support HTTPS with certificates exchange? I don't want it to skip the certificates

      readinessProbe:
        httpGet:
          path: /eh/heartbeat
          port: 2347
          scheme: HTTPS
        initialDelaySeconds: 210
        periodSeconds: 10
        timeoutSeconds: 5
-- Mary1
certificate
https
kubernetes
readinessprobe
schema

1 Answer

6/30/2020

You can use Readiness command instead of HTTP request. This will give you complete control over the check, including the certificate exchange.

So, instead of:

readinessProbe:
    httpGet:
      path: /eh/heartbeat
      port: 2347
      scheme: HTTPS

, you would have something like:

readinessProbe:
  exec:
    command:
    - python
    - your_script.py

Be sure the script returns 0 if all is well, and non-zero value on failure. (python your_script.py is, of course, just one example. You would know what is the best approach for you)

-- Dragan Bocevski
Source: StackOverflow