Why is my kubernetes readiness probe for hashicorp vault hitting http when I specify https?

Viewed 334

My readiness probe specifies HTTPS and 8200 as the port to check my hashicorp vault pod.

  readinessProbe:
    httpGet:
      scheme: HTTPS
      path: '/v1/sys/health?activecode=200'
      port: 8200

Once the pod is running kubectl describe pod shows this

Readiness probe failed: Error checking seal status: Error making API request.

URL: GET http://127.0.0.1:8200/v1/sys/seal-status
Code: 400. Raw Message:

Client sent an HTTP request to an HTTPS server.
1 Answers

I have found this similar problem. See the whole answer here.

According to this documentation:

The http/https scheme is controlled by the tlsDisable value.

When set to true, changes URLs from https to http (such as the VAULT_ADDR=http://127.0.0.1:8200 environment variable set on the Vault pods).

To turn it off:

global:
  tlsDisable: false

NOTE: Vault should always be used with TLS in production to provide secure communication between clients and the Vault server. It requires a certificate file and key file on each host where Vault is running.


See also this documentation. One can find there many examples of using readiness and liveness probes, f.e

    readinessProbe:
      exec:
        command:
        - /bin/sh
        - -ec
        - vault status
      initialDelaySeconds: 5
      periodSeconds: 5
Related