Skip to content

Commit

Permalink
Make liveness/readiness probes configurable (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
James Halsall authored Feb 24, 2020
1 parent b79908c commit 987d108
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 6 deletions.
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@ root = true

[*]
insert_final_newline = true

[{*.yml,*.yaml,*.yml.twig,*.yaml.twig}]
indent_style = space
indent_size = 2
Empty file.
3 changes: 3 additions & 0 deletions helm/app/templates/_container-ports.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{{- define "container.ports" }}
- containerPort: {{ .Values.default_port.port }}
{{- end }}
12 changes: 12 additions & 0 deletions helm/app/templates/_probes.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{- define "probes" }}
readinessProbe:
tcpSocket:
port: {{ .Values.health_port }}
initialDelaySeconds: 5
periodSeconds: 10
livenessProbe:
tcpSocket:
port: {{ .Values.health_port }}
initialDelaySeconds: 10
periodSeconds: 10
{{- end }}
8 changes: 2 additions & 6 deletions helm/app/templates/application/app/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,9 @@ spec:
imagePullPolicy: Always
name: app
ports:
- containerPort: {{ .Values.default_port.port }}
{{- include "container.ports" . | indent 8 }}
resources: {}
readinessProbe:
tcpSocket:
port: {{ .Values.health_port }}
initialDelaySeconds: 5
periodSeconds: 10
{{- include "probes" . | indent 8 }}
imagePullSecrets:
- name: {{ .Values.resourcePrefix }}docker-config
restartPolicy: Always
Expand Down
2 changes: 2 additions & 0 deletions helm/app/values.yaml.twig
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,5 @@ health_port: {{ @('app.health_port') }}
ingress:
{{ to_yaml(@('app.ingress'), 2, 2) | raw }}
resourcePrefix: {{ @('pipeline.base.resourcePrefix') | json_encode | raw }}

{% include blocks ~ 'additional.yml.twig' %}

0 comments on commit 987d108

Please sign in to comment.