From 521844a5ff19daa618d7f2b5a51d0b7171cf0006 Mon Sep 17 00:00:00 2001 From: Simon Larsen Date: Mon, 18 Nov 2024 15:07:51 +0000 Subject: [PATCH] Add liveness and readiness probe configuration options to Helm chart templates --- HelmChart/Public/oneuptime/templates/api-reference.yaml | 4 ++++ HelmChart/Public/oneuptime/templates/app.yaml | 5 +++++ HelmChart/Public/oneuptime/templates/docs.yaml | 5 +++++ HelmChart/Public/oneuptime/templates/home.yaml | 5 +++++ HelmChart/Public/oneuptime/templates/ingestor.yaml | 5 +++++ HelmChart/Public/oneuptime/templates/nginx.yaml | 5 +++++ HelmChart/Public/oneuptime/templates/worker.yaml | 4 ++++ HelmChart/Public/oneuptime/templates/workflow.yaml | 4 ++++ HelmChart/Public/oneuptime/values.yaml | 4 ++++ 9 files changed, 41 insertions(+) diff --git a/HelmChart/Public/oneuptime/templates/api-reference.yaml b/HelmChart/Public/oneuptime/templates/api-reference.yaml index fc8c5c46a8..d68e7e89be 100644 --- a/HelmChart/Public/oneuptime/templates/api-reference.yaml +++ b/HelmChart/Public/oneuptime/templates/api-reference.yaml @@ -41,6 +41,7 @@ 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.enableLivenessProbe }} # Liveness probe livenessProbe: httpGet: @@ -49,6 +50,8 @@ spec: initialDelaySeconds: 60 periodSeconds: 10 timeoutSeconds: 30 + {{- end }} + {{- if $.Values.enableReadinessProbe }} # Readyness Probe readinessProbe: httpGet: @@ -57,6 +60,7 @@ spec: initialDelaySeconds: 60 periodSeconds: 10 timeoutSeconds: 30 + {{- end }} {{- if $.Values.containerSecurityContext }} securityContext: {{- $.Values.containerSecurityContext | toYaml | nindent 12 }} {{- end }} diff --git a/HelmChart/Public/oneuptime/templates/app.yaml b/HelmChart/Public/oneuptime/templates/app.yaml index 24c6ea0b2f..8893d0bc36 100644 --- a/HelmChart/Public/oneuptime/templates/app.yaml +++ b/HelmChart/Public/oneuptime/templates/app.yaml @@ -42,6 +42,8 @@ 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 }} + # Liveness probe livenessProbe: httpGet: path: /status/live @@ -49,6 +51,8 @@ spec: initialDelaySeconds: 60 periodSeconds: 10 timeoutSeconds: 30 + {{- end }} + {{- if $.Values.enableReadinessProbe }} # Readyness Probe readinessProbe: httpGet: @@ -57,6 +61,7 @@ spec: initialDelaySeconds: 60 periodSeconds: 10 timeoutSeconds: 30 + {{- end }} {{- if $.Values.containerSecurityContext }} securityContext: {{- $.Values.containerSecurityContext | toYaml | nindent 12 }} {{- end }} diff --git a/HelmChart/Public/oneuptime/templates/docs.yaml b/HelmChart/Public/oneuptime/templates/docs.yaml index cfe895b5fd..70a0c26c51 100644 --- a/HelmChart/Public/oneuptime/templates/docs.yaml +++ b/HelmChart/Public/oneuptime/templates/docs.yaml @@ -42,6 +42,8 @@ spec: - image: {{ printf "%s/%s/%s:%s" $.Values.image.registry $.Values.image.repository "docs" $.Values.image.tag }} name: {{ printf "%s-%s" $.Release.Name "docs" }} # Liveness probe + {{- if $.Values.enableLivenessProbe }} + # Liveness probe livenessProbe: httpGet: path: /status/live @@ -49,6 +51,8 @@ spec: initialDelaySeconds: 60 periodSeconds: 10 timeoutSeconds: 30 + {{- end }} + {{- if $.Values.enableReadinessProbe }} # Readyness Probe readinessProbe: httpGet: @@ -57,6 +61,7 @@ spec: initialDelaySeconds: 60 periodSeconds: 10 timeoutSeconds: 30 + {{- end }} {{- if $.Values.containerSecurityContext }} securityContext: {{- $.Values.containerSecurityContext | toYaml | nindent 12 }} {{- end }} diff --git a/HelmChart/Public/oneuptime/templates/home.yaml b/HelmChart/Public/oneuptime/templates/home.yaml index 0162faed2d..e254b8aaa8 100644 --- a/HelmChart/Public/oneuptime/templates/home.yaml +++ b/HelmChart/Public/oneuptime/templates/home.yaml @@ -42,6 +42,8 @@ spec: - image: {{ printf "%s/%s/%s:%s" $.Values.image.registry $.Values.image.repository "home" $.Values.image.tag }} name: {{ printf "%s-%s" $.Release.Name "home" }} # Liveness probe + {{- if $.Values.enableLivenessProbe }} + # Liveness probe livenessProbe: httpGet: path: /status/live @@ -49,6 +51,8 @@ spec: initialDelaySeconds: 60 periodSeconds: 10 timeoutSeconds: 30 + {{- end }} + {{- if $.Values.enableReadinessProbe }} # Readyness Probe readinessProbe: httpGet: @@ -57,6 +61,7 @@ spec: initialDelaySeconds: 60 periodSeconds: 10 timeoutSeconds: 30 + {{- end }} {{- if $.Values.containerSecurityContext }} securityContext: {{- $.Values.containerSecurityContext | toYaml | nindent 12 }} {{- end }} diff --git a/HelmChart/Public/oneuptime/templates/ingestor.yaml b/HelmChart/Public/oneuptime/templates/ingestor.yaml index c61d176698..9960035f41 100644 --- a/HelmChart/Public/oneuptime/templates/ingestor.yaml +++ b/HelmChart/Public/oneuptime/templates/ingestor.yaml @@ -51,6 +51,8 @@ spec: - image: {{ printf "%s/%s/%s:%s" $.Values.image.registry $.Values.image.repository "ingestor" $.Values.image.tag }} name: {{ printf "%s-%s" $.Release.Name "ingestor" }} # Liveness probe + {{- if $.Values.enableLivenessProbe }} + # Liveness probe livenessProbe: httpGet: path: /status/live @@ -58,6 +60,8 @@ spec: initialDelaySeconds: 60 periodSeconds: 10 timeoutSeconds: 30 + {{- end }} + {{- if $.Values.enableReadinessProbe }} # Readyness Probe readinessProbe: httpGet: @@ -66,6 +70,7 @@ spec: initialDelaySeconds: 60 periodSeconds: 10 timeoutSeconds: 30 + {{- end }} {{- if $.Values.containerSecurityContext }} securityContext: {{- $.Values.containerSecurityContext | toYaml | nindent 12 }} {{- end }} diff --git a/HelmChart/Public/oneuptime/templates/nginx.yaml b/HelmChart/Public/oneuptime/templates/nginx.yaml index 22a3a61821..05ed6ed653 100644 --- a/HelmChart/Public/oneuptime/templates/nginx.yaml +++ b/HelmChart/Public/oneuptime/templates/nginx.yaml @@ -56,6 +56,8 @@ spec: - image: {{ printf "%s/%s/%s:%s" $.Values.image.registry $.Values.image.repository "nginx" $.Values.image.tag }} name: {{ printf "%s-%s" $.Release.Name "nginx" }} # Liveness probe + {{- if $.Values.enableLivenessProbe }} + # Liveness probe livenessProbe: httpGet: path: /status/live @@ -63,6 +65,8 @@ spec: initialDelaySeconds: 60 periodSeconds: 10 timeoutSeconds: 30 + {{- end }} + {{- if $.Values.enableReadinessProbe }} # Readyness Probe readinessProbe: httpGet: @@ -71,6 +75,7 @@ spec: initialDelaySeconds: 60 periodSeconds: 10 timeoutSeconds: 30 + {{- end }} volumeMounts: - name: status-page-certs mountPath: /etc/nginx/certs/StatusPageCerts diff --git a/HelmChart/Public/oneuptime/templates/worker.yaml b/HelmChart/Public/oneuptime/templates/worker.yaml index 9085f98c12..5a7287f075 100644 --- a/HelmChart/Public/oneuptime/templates/worker.yaml +++ b/HelmChart/Public/oneuptime/templates/worker.yaml @@ -41,6 +41,7 @@ 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 }} # Liveness probe livenessProbe: httpGet: @@ -49,6 +50,8 @@ spec: initialDelaySeconds: 60 periodSeconds: 10 timeoutSeconds: 30 + {{- end }} + {{- if $.Values.enableReadinessProbe }} # Readyness Probe readinessProbe: httpGet: @@ -57,6 +60,7 @@ spec: initialDelaySeconds: 60 periodSeconds: 10 timeoutSeconds: 30 + {{- end }} {{- if $.Values.containerSecurityContext }} securityContext: {{- $.Values.containerSecurityContext | toYaml | nindent 12 }} {{- end }} diff --git a/HelmChart/Public/oneuptime/templates/workflow.yaml b/HelmChart/Public/oneuptime/templates/workflow.yaml index dbe31dd3f5..68ddf100e2 100644 --- a/HelmChart/Public/oneuptime/templates/workflow.yaml +++ b/HelmChart/Public/oneuptime/templates/workflow.yaml @@ -41,6 +41,7 @@ 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.enableLivenessProbe }} # Liveness probe livenessProbe: httpGet: @@ -49,6 +50,8 @@ spec: initialDelaySeconds: 60 periodSeconds: 10 timeoutSeconds: 30 + {{- end }} + {{- if $.Values.enableReadinessProbe }} # Readyness Probe readinessProbe: httpGet: @@ -57,6 +60,7 @@ spec: initialDelaySeconds: 60 periodSeconds: 10 timeoutSeconds: 30 + {{- end }} {{- if $.Values.containerSecurityContext }} securityContext: {{- $.Values.containerSecurityContext | toYaml | nindent 12 }} {{- end }} diff --git a/HelmChart/Public/oneuptime/values.yaml b/HelmChart/Public/oneuptime/values.yaml index 0043d3de25..21f341abcb 100644 --- a/HelmChart/Public/oneuptime/values.yaml +++ b/HelmChart/Public/oneuptime/values.yaml @@ -363,3 +363,7 @@ notifications: webhooks: # This is the webhook that will be called when a user is created or signs up. onCreateUser: + + +enableLivenessProbe: true +enableReadinessProbe: true \ No newline at end of file