Skip to content

Commit

Permalink
[prometheus-adapter] Add support for configuring probes (#3273)
Browse files Browse the repository at this point in the history
* Add support for configuring livenessProbe and readinessProbe in the
  values file

Signed-off-by: zeritti <47476160+zeritti@users.noreply.github.com>
  • Loading branch information
zeritti committed Apr 23, 2023
1 parent 240daaf commit dd5f89e
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 13 deletions.
2 changes: 1 addition & 1 deletion charts/prometheus-adapter/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v1
name: prometheus-adapter
version: 4.1.1
version: 4.2.0
appVersion: v0.10.0
description: A Helm chart for k8s prometheus adapter
home: https://github.com/kubernetes-sigs/prometheus-adapter
Expand Down
4 changes: 4 additions & 0 deletions charts/prometheus-adapter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ helm upgrade [RELEASE_NAME] [CHART] --install

_See [helm upgrade](https://helm.sh/docs/helm/helm_upgrade/) for command documentation._

### To 4.2.0

Readiness and liveness probes are now fully configurable through values `readinessProbe` and `livenessProbe`. The previous values have been kept as defaults.

### To 4.0.0

Previously, security context of the container was set directly in the deployment template. This release makes it configurable through the new configuration variable `securityContext` whilst keeping the previously set values as defaults. Furthermore, previous variable `runAsUser` is now set in `securityContext` and is not used any longer. Please, use `securityContext.runAsUser` instead. In the same security context, `seccompProfile` has been enabled and set to type `RuntimeDefault`.
Expand Down
18 changes: 6 additions & 12 deletions charts/prometheus-adapter/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,20 +71,14 @@ spec:
ports:
- containerPort: {{ .Values.listenPort }}
name: https
{{- with .Values.livenessProbe }}
livenessProbe:
httpGet:
path: /healthz
port: https
scheme: HTTPS
initialDelaySeconds: 30
timeoutSeconds: 5
{{- toYaml . | nindent 10 }}
{{- end }}
{{- with .Values.readinessProbe }}
readinessProbe:
httpGet:
path: /healthz
port: https
scheme: HTTPS
initialDelaySeconds: 30
timeoutSeconds: 5
{{- toYaml . | nindent 10 }}
{{- end }}
{{- if .Values.resources }}
resources:
{{- toYaml .Values.resources | nindent 10 }}
Expand Down
19 changes: 19 additions & 0 deletions charts/prometheus-adapter/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,25 @@ resources: {}
# cpu: 100m
# memory: 128Mi

# Configure liveness probe
# https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#Probe
livenessProbe:
httpGet:
path: /healthz
port: https
scheme: HTTPS
initialDelaySeconds: 30
timeoutSeconds: 5

# Configure readiness probe
readinessProbe:
httpGet:
path: /healthz
port: https
scheme: HTTPS
initialDelaySeconds: 30
timeoutSeconds: 5

rules:
default: true

Expand Down

0 comments on commit dd5f89e

Please sign in to comment.