Skip to content

Commit

Permalink
Add support for exec readiness probes (closes #56)
Browse files Browse the repository at this point in the history
  • Loading branch information
jparavisini committed Sep 26, 2022
1 parent 8999670 commit e250e0e
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Version 0.1.21 (2022-09-22)
---------------------------
charts/service-deployment: Add support for 'exec' readiness probes in deployment (#56)

Version 0.1.20 (2022-09-21)
---------------------------
charts/daemonset: Add opinionated chart for deploying a daemonset (#51)
Expand Down
2 changes: 1 addition & 1 deletion charts/service-deployment/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
name: service-deployment
description: A Helm Chart to setup a generic deployment with optional service/hpa bindings
version: 0.2.0
version: 0.3.0
icon: https://raw.githubusercontent.com/snowplow-devops/helm-charts/master/docs/logo/snowplow.png
home: https://github.com/snowplow-devops/helm-charts
sources:
Expand Down
3 changes: 2 additions & 1 deletion charts/service-deployment/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ helm delete service-deployment
| config.secrets | object | `{}` | Map of secrets that will be exposed as environment variables within the job |
| configMaps | list | `[]` | List of config maps to mount to the deployment |
| resources | object | `{}` | Map of resource constraints for the service |
| readinessProbe.httpGet.path | string | `""` | Path for health checks to be performed (note: set to "" to disable) |
| readinessProbe.httpGet.path | string | `""` | Path for health checks to be performed to determine readiness |
| readinessProbe.command.exec | list | `[]` | Command/arguments to execute to determine readiness |
| readinessProbe.initialDelaySeconds | int | `5` | |
| readinessProbe.periodSeconds | int | `5` | |
| readinessProbe.timeoutSeconds | int | `5` | |
Expand Down
19 changes: 14 additions & 5 deletions charts/service-deployment/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,21 @@ spec:
resources:
{{- toYaml .Values.resources | nindent 10 }}

{{- if ne .Values.readinessProbe.httpGet.path "" }}
{{- if or (ne .Values.readinessProbe.httpGet.path "") (.Values.readinessProbe.exec.command) }}
readinessProbe:
httpGet:
path: {{ .Values.readinessProbe.httpGet.path }}
port: {{ .Values.service.port }}
scheme: HTTP
{{- if ne .Values.readinessProbe.httpGet.path "" }}
httpGet:
path: {{ .Values.readinessProbe.httpGet.path }}
port: {{ .Values.service.port }}
scheme: HTTP
{{- end }}
{{- if gt (len .Values.readinessProbe.exec.command) 0 }}
exec:
command:
{{- range $v := .Values.readinessProbe.exec.command }}
- {{ $v }}
{{- end }}
{{- end }}
initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.readinessProbe.periodSeconds }}
timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }}
Expand Down
6 changes: 5 additions & 1 deletion charts/service-deployment/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,14 @@ resources: {}
# cpu: 400m
# memory: 512Mi

# -- readinessProbe is enabled if httpGet.path or exec.command are present
readinessProbe:
httpGet:
# -- Path for health checks to be performed (note: set to "" to disable)
# -- Path for health checks to be performed to determine readiness
path: ""
exec:
# -- Command/arguments to execute to determine readiness
command: []
initialDelaySeconds: 5
periodSeconds: 5
timeoutSeconds: 5
Expand Down

0 comments on commit e250e0e

Please sign in to comment.