How to set basic auth to Kubernetes' readinessProbe correctly?
If set this config for Kubernetes' readinessProbe
in deployment kind.
readinessProbe:
httpGet:
path: /healthcheck
port: 8080
httpHeaders:
- name: Authorization
value: Basic <real base64 encoded data>
Deploy it to GKE, GCP's health check can't pass to access the inside application with using basic authentication.
But from here, it seems it should use this syntax. Why can't pass?
The server side is using JSON response at the /healthcheck point. Is it also necessary to set Accept
or Content-Type
to the httpHeaders
?
And, is it good to set this health check to livenessProbe or readinessProbe?