Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[alertmanager] Readiness/liveness probe failed when using basic auth #5174

Open
yunex-ts opened this issue Jan 15, 2025 · 4 comments
Open

[alertmanager] Readiness/liveness probe failed when using basic auth #5174

yunex-ts opened this issue Jan 15, 2025 · 4 comments
Labels
bug Something isn't working

Comments

@yunex-ts
Copy link

Describe the bug a clear and concise description of what the bug is.

In a centrally running alertmanager opening and secured with basic auth, readiness and liveness probe will fail with error 401. Only http probes are allowed and not, like in prometheus, tcp checks

What's your helm version?

v3.15.2

What's your kubectl version?

v1.31.2

Which chart?

alertmanager

What's the chart version?

1.13.1

What happened?

I switched web.config to basic auth and the liveness and readiness probes failed with 401. Pod, of course, restarting

What you expected to happen?

I want to see liveness and readiness probe more configurable like in prometheus chart.
in values.yaml:

tcpSocketProbeEnabled: false
probeScheme: HTTP
readinessProbeInitialDelay: 30
readinessProbePeriodSeconds: 5
readinessProbeTimeout: 4
readinessProbeFailureThreshold: 3
readinessProbeSuccessThreshold: 1
livenessProbeInitialDelay: 30
livenessProbePeriodSeconds: 15
livenessProbeTimeout: 10
livenessProbeFailureThreshold: 3
livenessProbeSuccessThreshold: 1

in templates/statefulset.yaml:

readinessProbe:
  {{- if not .Values.tcpSocketProbeEnabled }}
  httpGet:
    path: {{ .Values.prefixURL }}/-/ready
    port: 9090
    scheme: {{ .Values.probeScheme }}
    {{- with .Values.probeHeaders }}
    httpHeaders:
  {{- toYaml . | nindent 14 }}
    {{- end }}
  {{- else }}
  tcpSocket:
    port: 9090
  {{- end }}
  initialDelaySeconds: {{ .Values.readinessProbeInitialDelay }}
  periodSeconds: {{ .Values.readinessProbePeriodSeconds }}
  timeoutSeconds: {{ .Values.readinessProbeTimeout }}
  failureThreshold: {{ .Values.readinessProbeFailureThreshold }}
  successThreshold: {{ .Values.readinessProbeSuccessThreshold }}
  livenessProbe:
  {{- if not .Values.tcpSocketProbeEnabled }}
  httpGet:
    path: {{ .Values.prefixURL }}/-/healthy
    port: 9090
    scheme: {{ .Values.probeScheme }}
    {{- with .Values.probeHeaders }}
    httpHeaders:
  {{- toYaml . | nindent 14 }}
    {{- end }}
  {{- else }}
  tcpSocket:
    port: 9090
  {{- end }}
  initialDelaySeconds: {{ .Values.livenessProbeInitialDelay }}
  periodSeconds: {{ .Values.livenessProbePeriodSeconds }}
  timeoutSeconds: {{ .Values.livenessProbeTimeout }}
  failureThreshold: {{ .Values.livenessProbeFailureThreshold }}
  successThreshold: {{ .Values.livenessProbeSuccessThreshold }}

How to reproduce it?

Just activate basic-auth in alertmanager

Enter the changed values of values.yaml?

extraSecretMounts:
  - name: admin-generic-secret-mount
    secretName: admin-pass-secret
    mountPath: /etc/secret
    subPath: ""
    readOnly: true
extraArgs:
  web.config.file: /etc/secret/web.config.yml
```

### Enter the command that you execute and failing/misfunctioning.

helm install alertmanager prometheus-community/alertmanager --version 1.13.1 --values values.yaml

### Anything else we need to know?

_No response_
@yunex-ts yunex-ts added the bug Something isn't working label Jan 15, 2025
@zeritti
Copy link
Member

zeritti commented Jan 15, 2025

The chart may not be offering a flexible configuration at the moment but tcpSocket can still be defined in most conditions:

livenessProbe:
  httpGet: null
  tcpSocket:
    port: http
readinessProbe:
  httpGet: null
  tcpSocket:
    port: http

@yunex-ts
Copy link
Author

I tried that of course 👍
But it does not work. I cant select two types is the error message

@yunex-ts
Copy link
Author

It will work in case there is a condition within the template to not add that key if httpGetis null

@zeritti
Copy link
Member

zeritti commented Jan 15, 2025

I see. I cannot make it error out, though, the chart gets rolled out straight away with the changed probe type. I reckon it would fail in case of being installed as a subchart.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants