Skip to content

Commit

Permalink
Refactor health check configurations to use structured probes in valu…
Browse files Browse the repository at this point in the history
…es.yaml and templates
  • Loading branch information
simlarsen committed Nov 21, 2024
1 parent 197e4e6 commit 1fba734
Show file tree
Hide file tree
Showing 9 changed files with 113 additions and 110 deletions.
26 changes: 11 additions & 15 deletions HelmChart/Public/oneuptime/templates/api-reference.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,38 +41,34 @@ spec:
containers:
- image: {{ printf "%s/%s/%s:%s" $.Values.image.registry $.Values.image.repository "api-reference" $.Values.image.tag }}
name: {{ printf "%s-%s" $.Release.Name "api-reference" }}
{{- if $.Values.startupProbes.enabled }}
{{- if $.Values.startupProbe.enabled }}
# Startup probe
startupProbe:
httpGet:
path: /status/live
port: {{ $.Values.port.apiReference }}
periodSeconds: {{ $.Values.startupProbes.periodSeconds }}
failureThreshold: {{ $.Values.startupProbes.failureThreshold }}
periodSeconds: {{ $.Values.startupProbe.periodSeconds }}
failureThreshold: {{ $.Values.startupProbe.failureThreshold }}
{{- end }}
{{- if $.Values.enableLivenessProbe }}
{{- if $.Values.livenessProbe.enabled }}
# Liveness probe
livenessProbe:
httpGet:
path: /status/live
port: {{ $.Values.port.apiReference }}
periodSeconds: 10
timeoutSeconds: 30
{{- if not $.Values.startupProbes.enabled }}
initialDelaySeconds: {{ $.Values.initialDelaySeconds }}
{{- end }}
periodSeconds: {{ $.Values.livenessProbe.periodSeconds }}
timeoutSeconds: {{ $.Values.livenessProbe.timeoutSeconds }}
initialDelaySeconds: {{ $.Values.livenessProbe.initialDelaySeconds }}
{{- end }}
{{- if $.Values.enableReadinessProbe }}
{{- if $.Values.readinessProbe.enabled }}
# Readyness Probe
readinessProbe:
httpGet:
path: /status/ready
port: {{ $.Values.port.apiReference }}
periodSeconds: 10
{{- if not $.Values.startupProbes.enabled }}
initialDelaySeconds: {{ $.Values.initialDelaySeconds }}
{{- end }}
timeoutSeconds: 30
periodSeconds: {{ $.Values.readinessProbe.periodSeconds }}
initialDelaySeconds: {{ $.Values.readinessProbe.initialDelaySeconds }}
timeoutSeconds: {{ $.Values.readinessProbe.timeoutSeconds }}
{{- end }}
{{- if $.Values.containerSecurityContext }}
securityContext: {{- $.Values.containerSecurityContext | toYaml | nindent 12 }}
Expand Down
25 changes: 17 additions & 8 deletions HelmChart/Public/oneuptime/templates/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,25 +42,34 @@ spec:
- image: {{ printf "%s/%s/%s:%s" $.Values.image.registry $.Values.image.repository "app" $.Values.image.tag }}
name: {{ printf "%s-%s" $.Release.Name "app" }}
# Liveness probe
{{- if $.Values.enableLivenessProbe }}
{{- if $.Values.startupProbe.enabled }}
# Startup probe
startupProbe:
httpGet:
path: /status/live
port: {{ $.Values.port.app }}
periodSeconds: {{ $.Values.startupProbe.periodSeconds }}
failureThreshold: {{ $.Values.startupProbe.failureThreshold }}
{{- end }}
{{- if $.Values.livenessProbe.enabled }}
# Liveness probe
livenessProbe:
httpGet:
path: /status/live
port: {{ $.Values.port.app }}
initialDelaySeconds: 60
periodSeconds: 10
timeoutSeconds: 30
periodSeconds: {{ $.Values.livenessProbe.periodSeconds }}
timeoutSeconds: {{ $.Values.livenessProbe.timeoutSeconds }}
initialDelaySeconds: {{ $.Values.livenessProbe.initialDelaySeconds }}
{{- end }}
{{- if $.Values.enableReadinessProbe }}
{{- if $.Values.readinessProbe.enabled }}
# Readyness Probe
readinessProbe:
httpGet:
path: /status/ready
port: {{ $.Values.port.app }}
initialDelaySeconds: 60
periodSeconds: 10
timeoutSeconds: 30
periodSeconds: {{ $.Values.readinessProbe.periodSeconds }}
initialDelaySeconds: {{ $.Values.readinessProbe.initialDelaySeconds }}
timeoutSeconds: {{ $.Values.readinessProbe.timeoutSeconds }}
{{- end }}
{{- if $.Values.containerSecurityContext }}
securityContext: {{- $.Values.containerSecurityContext | toYaml | nindent 12 }}
Expand Down
26 changes: 11 additions & 15 deletions HelmChart/Public/oneuptime/templates/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,38 +41,34 @@ spec:
containers:
- image: {{ printf "%s/%s/%s:%s" $.Values.image.registry $.Values.image.repository "docs" $.Values.image.tag }}
name: {{ printf "%s-%s" $.Release.Name "docs" }}
{{- if $.Values.startupProbes.enabled }}
{{- if $.Values.startupProbe.enabled }}
# Startup probe
startupProbe:
httpGet:
path: /status/live
port: {{ $.Values.port.docs }}
periodSeconds: {{ $.Values.startupProbes.periodSeconds }}
failureThreshold: {{ $.Values.startupProbes.failureThreshold }}
periodSeconds: {{ $.Values.startupProbe.periodSeconds }}
failureThreshold: {{ $.Values.startupProbe.failureThreshold }}
{{- end }}
{{- if $.Values.enableLivenessProbe }}
{{- if $.Values.livenessProbe.enabled }}
# Liveness probe
livenessProbe:
httpGet:
path: /status/live
port: {{ $.Values.port.docs }}
{{- if not $.Values.startupProbes.enabled }}
initialDelaySeconds: {{ $.Values.initialDelaySeconds }}
{{- end }}
periodSeconds: 10
timeoutSeconds: 30
periodSeconds: {{ $.Values.livenessProbe.periodSeconds }}
timeoutSeconds: {{ $.Values.livenessProbe.timeoutSeconds }}
initialDelaySeconds: {{ $.Values.livenessProbe.initialDelaySeconds }}
{{- end }}
{{- if $.Values.enableReadinessProbe }}
{{- if $.Values.readinessProbe.enabled }}
# Readyness Probe
readinessProbe:
httpGet:
path: /status/ready
port: {{ $.Values.port.docs }}
{{- if not $.Values.startupProbes.enabled }}
initialDelaySeconds: {{ $.Values.initialDelaySeconds }}
{{- end }}
periodSeconds: 10
timeoutSeconds: 30
periodSeconds: {{ $.Values.readinessProbe.periodSeconds }}
initialDelaySeconds: {{ $.Values.readinessProbe.initialDelaySeconds }}
timeoutSeconds: {{ $.Values.readinessProbe.timeoutSeconds }}
{{- end }}
{{- if $.Values.containerSecurityContext }}
securityContext: {{- $.Values.containerSecurityContext | toYaml | nindent 12 }}
Expand Down
26 changes: 11 additions & 15 deletions HelmChart/Public/oneuptime/templates/home.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,38 +41,34 @@ spec:
containers:
- image: {{ printf "%s/%s/%s:%s" $.Values.image.registry $.Values.image.repository "home" $.Values.image.tag }}
name: {{ printf "%s-%s" $.Release.Name "home" }}
{{- if $.Values.startupProbes.enabled }}
{{- if $.Values.startupProbe.enabled }}
# Startup probe
startupProbe:
httpGet:
path: /status/live
port: {{ $.Values.port.home }}
periodSeconds: {{ $.Values.startupProbes.periodSeconds }}
failureThreshold: {{ $.Values.startupProbes.failureThreshold }}
periodSeconds: {{ $.Values.startupProbe.periodSeconds }}
failureThreshold: {{ $.Values.startupProbe.failureThreshold }}
{{- end }}
{{- if $.Values.enableLivenessProbe }}
{{- if $.Values.livenessProbe.enabled }}
# Liveness probe
livenessProbe:
httpGet:
path: /status/live
port: {{ $.Values.port.home }}
{{- if not $.Values.startupProbes.enabled }}
initialDelaySeconds: {{ $.Values.initialDelaySeconds }}
{{- end }}
periodSeconds: 10
timeoutSeconds: 30
periodSeconds: {{ $.Values.livenessProbe.periodSeconds }}
timeoutSeconds: {{ $.Values.livenessProbe.timeoutSeconds }}
initialDelaySeconds: {{ $.Values.livenessProbe.initialDelaySeconds }}
{{- end }}
{{- if $.Values.enableReadinessProbe }}
{{- if $.Values.readinessProbe.enabled }}
# Readyness Probe
readinessProbe:
httpGet:
path: /status/ready
port: {{ $.Values.port.home }}
{{- if not $.Values.startupProbes.enabled }}
initialDelaySeconds: {{ $.Values.initialDelaySeconds }}
{{- end }}
periodSeconds: 10
timeoutSeconds: 30
periodSeconds: {{ $.Values.readinessProbe.periodSeconds }}
initialDelaySeconds: {{ $.Values.readinessProbe.initialDelaySeconds }}
timeoutSeconds: {{ $.Values.readinessProbe.timeoutSeconds }}
{{- end }}
{{- if $.Values.containerSecurityContext }}
securityContext: {{- $.Values.containerSecurityContext | toYaml | nindent 12 }}
Expand Down
26 changes: 11 additions & 15 deletions HelmChart/Public/oneuptime/templates/ingestor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,38 +50,34 @@ spec:
containers:
- image: {{ printf "%s/%s/%s:%s" $.Values.image.registry $.Values.image.repository "ingestor" $.Values.image.tag }}
name: {{ printf "%s-%s" $.Release.Name "ingestor" }}
{{- if $.Values.startupProbes.enabled }}
{{- if $.Values.startupProbe.enabled }}
# Startup probe
startupProbe:
httpGet:
path: /status/live
port: {{ $.Values.port.ingestor }}
periodSeconds: {{ $.Values.startupProbes.periodSeconds }}
failureThreshold: {{ $.Values.startupProbes.failureThreshold }}
periodSeconds: {{ $.Values.startupProbe.periodSeconds }}
failureThreshold: {{ $.Values.startupProbe.failureThreshold }}
{{- end }}
{{- if $.Values.enableLivenessProbe }}
{{- if $.Values.livenessProbe.enabled }}
# Liveness probe
livenessProbe:
httpGet:
path: /status/live
port: {{ $.Values.port.ingestor }}
{{- if not $.Values.startupProbes.enabled }}
initialDelaySeconds: {{ $.Values.initialDelaySeconds }}
{{- end }}
periodSeconds: 10
timeoutSeconds: 30
periodSeconds: {{ $.Values.livenessProbe.periodSeconds }}
timeoutSeconds: {{ $.Values.livenessProbe.timeoutSeconds }}
initialDelaySeconds: {{ $.Values.livenessProbe.initialDelaySeconds }}
{{- end }}
{{- if $.Values.enableReadinessProbe }}
{{- if $.Values.readinessProbe.enabled }}
# Readyness Probe
readinessProbe:
httpGet:
path: /status/ready
port: {{ $.Values.port.ingestor }}
{{- if not $.Values.startupProbes.enabled }}
initialDelaySeconds: {{ $.Values.initialDelaySeconds }}
{{- end }}
periodSeconds: 10
timeoutSeconds: 30
periodSeconds: {{ $.Values.readinessProbe.periodSeconds }}
initialDelaySeconds: {{ $.Values.readinessProbe.initialDelaySeconds }}
timeoutSeconds: {{ $.Values.readinessProbe.timeoutSeconds }}
{{- end }}
{{- if $.Values.containerSecurityContext }}
securityContext: {{- $.Values.containerSecurityContext | toYaml | nindent 12 }}
Expand Down
26 changes: 11 additions & 15 deletions HelmChart/Public/oneuptime/templates/nginx.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,38 +55,34 @@ spec:
containers:
- image: {{ printf "%s/%s/%s:%s" $.Values.image.registry $.Values.image.repository "nginx" $.Values.image.tag }}
name: {{ printf "%s-%s" $.Release.Name "nginx" }}
{{- if $.Values.startupProbes.enabled }}
{{{- if $.Values.startupProbe.enabled }}
# Startup probe
startupProbe:
httpGet:
path: /status/live
port: 7851
periodSeconds: {{ $.Values.startupProbes.periodSeconds }}
failureThreshold: {{ $.Values.startupProbes.failureThreshold }}
periodSeconds: {{ $.Values.startupProbe.periodSeconds }}
failureThreshold: {{ $.Values.startupProbe.failureThreshold }}
{{- end }}
{{- if $.Values.enableLivenessProbe }}
{{- if $.Values.livenessProbe.enabled }}
# Liveness probe
livenessProbe:
httpGet:
path: /status/live
port: 7851
{{- if not $.Values.startupProbes.enabled }}
initialDelaySeconds: {{ $.Values.initialDelaySeconds }}
{{- end }}
periodSeconds: 10
timeoutSeconds: 30
periodSeconds: {{ $.Values.livenessProbe.periodSeconds }}
timeoutSeconds: {{ $.Values.livenessProbe.timeoutSeconds }}
initialDelaySeconds: {{ $.Values.livenessProbe.initialDelaySeconds }}
{{- end }}
{{- if $.Values.enableReadinessProbe }}
{{- if $.Values.readinessProbe.enabled }}
# Readyness Probe
readinessProbe:
httpGet:
path: /status/ready
port: 7851
{{- if not $.Values.startupProbes.enabled }}
initialDelaySeconds: {{ $.Values.initialDelaySeconds }}
{{- end }}
periodSeconds: 10
timeoutSeconds: 30
periodSeconds: {{ $.Values.readinessProbe.periodSeconds }}
initialDelaySeconds: {{ $.Values.readinessProbe.initialDelaySeconds }}
timeoutSeconds: {{ $.Values.readinessProbe.timeoutSeconds }}
{{- end }}
volumeMounts:
- name: status-page-certs
Expand Down
25 changes: 17 additions & 8 deletions HelmChart/Public/oneuptime/templates/worker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,25 +41,34 @@ spec:
containers:
- image: {{ printf "%s/%s/%s:%s" $.Values.image.registry $.Values.image.repository "worker" $.Values.image.tag }}
name: {{ printf "%s-%s" $.Release.Name "worker" }}
{{- if $.Values.enableLivenessProbe }}
{{- if $.Values.startupProbe.enabled }}
# Startup probe
startupProbe:
httpGet:
path: /status/live
port: {{ $.Values.port.worker }}
periodSeconds: {{ $.Values.startupProbe.periodSeconds }}
failureThreshold: {{ $.Values.startupProbe.failureThreshold }}
{{- end }}
{{- if $.Values.livenessProbe.enabled }}
# Liveness probe
livenessProbe:
httpGet:
path: /status/live
port: {{ $.Values.port.worker }}
initialDelaySeconds: 60
periodSeconds: 10
timeoutSeconds: 30
periodSeconds: {{ $.Values.livenessProbe.periodSeconds }}
timeoutSeconds: {{ $.Values.livenessProbe.timeoutSeconds }}
initialDelaySeconds: {{ $.Values.livenessProbe.initialDelaySeconds }}
{{- end }}
{{- if $.Values.enableReadinessProbe }}
{{- if $.Values.readinessProbe.enabled }}
# Readyness Probe
readinessProbe:
httpGet:
path: /status/ready
port: {{ $.Values.port.worker }}
initialDelaySeconds: 60
periodSeconds: 10
timeoutSeconds: 30
periodSeconds: {{ $.Values.readinessProbe.periodSeconds }}
initialDelaySeconds: {{ $.Values.readinessProbe.initialDelaySeconds }}
timeoutSeconds: {{ $.Values.readinessProbe.timeoutSeconds }}
{{- end }}
{{- if $.Values.containerSecurityContext }}
securityContext: {{- $.Values.containerSecurityContext | toYaml | nindent 12 }}
Expand Down
26 changes: 11 additions & 15 deletions HelmChart/Public/oneuptime/templates/workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,38 +41,34 @@ spec:
containers:
- image: {{ printf "%s/%s/%s:%s" $.Values.image.registry $.Values.image.repository "workflow" $.Values.image.tag }}
name: {{ printf "%s-%s" $.Release.Name "workflow" }}
{{- if $.Values.startupProbes.enabled }}
{{- if $.Values.startupProbe.enabled }}
# Startup probe
startupProbe:
httpGet:
path: /status/live
port: {{ $.Values.port.workflow }}
periodSeconds: {{ $.Values.startupProbes.periodSeconds }}
failureThreshold: {{ $.Values.startupProbes.failureThreshold }}
periodSeconds: {{ $.Values.startupProbe.periodSeconds }}
failureThreshold: {{ $.Values.startupProbe.failureThreshold }}
{{- end }}
{{- if $.Values.enableLivenessProbe }}
{{- if $.Values.livenessProbe.enabled }}
# Liveness probe
livenessProbe:
httpGet:
path: /status/live
port: {{ $.Values.port.workflow }}
{{- if not $.Values.startupProbes.enabled }}
initialDelaySeconds: {{ $.Values.initialDelaySeconds }}
{{- end }}
periodSeconds: 10
timeoutSeconds: 30
periodSeconds: {{ $.Values.livenessProbe.periodSeconds }}
timeoutSeconds: {{ $.Values.livenessProbe.timeoutSeconds }}
initialDelaySeconds: {{ $.Values.livenessProbe.initialDelaySeconds }}
{{- end }}
{{- if $.Values.enableReadinessProbe }}
{{- if $.Values.readinessProbe.enabled }}
# Readyness Probe
readinessProbe:
httpGet:
path: /status/ready
port: {{ $.Values.port.workflow }}
{{- if not $.Values.startupProbes.enabled }}
initialDelaySeconds: {{ $.Values.initialDelaySeconds }}
{{- end }}
periodSeconds: 10
timeoutSeconds: 30
periodSeconds: {{ $.Values.readinessProbe.periodSeconds }}
initialDelaySeconds: {{ $.Values.readinessProbe.initialDelaySeconds }}
timeoutSeconds: {{ $.Values.readinessProbe.timeoutSeconds }}
{{- end }}
{{- if $.Values.containerSecurityContext }}
securityContext: {{- $.Values.containerSecurityContext | toYaml | nindent 12 }}
Expand Down
Loading

0 comments on commit 1fba734

Please sign in to comment.