Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

With basic auth enabled, k8s startup probe fails #93

Open
chessracer opened this issue Nov 25, 2024 · 1 comment
Open

With basic auth enabled, k8s startup probe fails #93

chessracer opened this issue Nov 25, 2024 · 1 comment

Comments

@chessracer
Copy link

If I enable basic auth via BASIC_AUTH_ENABLE: true
I'm unable to complete a deployment on k8s due to failing startup probes. Workaround for now has been to disable the startup / liveness / readiness probes

I can confirm that the endpoint /api/result used for the health check requires credentials if basic auth is enabled.

running from debug container:
We get a 401 without creds:
curl http://localhost:8080/api/result <!doctype html><html lang="en"><head><title>HTTP Status 401 – Unauthorized</title><style type="text/css">...

while if we provide the basic auth credentials, the healthcheck endpoint is available:
curl -u admin:admin http://localhost:8080/api/result []#

Suggestion is to implement a standard endpoint /healthz which is exempt from auth and can be used by the k8s healthchecks

@chessracer
Copy link
Author

I've been able to workaround this by the following additions. Will raise a PR for this.

templates/deployment.yaml

    livenessProbe:
        httpGet:
          path: /api/result
          port: http
          {{- if .Values.basicAuth.enabled }}
          httpHeaders:
            - name: Authorization
              value: Basic {{ .Values.basicAuth.base64EncodedPassword }}
          {{- end }}
        initialDelaySeconds: {{ .Values.livenessInitialDelay }}
        periodSeconds: 30

values.yaml

basicAuth:
  enabled: true
  base64EncodedPassword: <encoded value>

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

No branches or pull requests

1 participant