Mary1
Mary1

Reputation: 339

How to verify certificates for Liveness probe configured to https?

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

Upvotes: 2

Views: 1875

Answers (1)

Dragan Bocevski
Dragan Bocevski

Reputation: 51

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)

Upvotes: 2

Related Questions