From 0935010f893f82df02a8e59f3182464435c91b59 Mon Sep 17 00:00:00 2001 From: "d.viti" Date: Wed, 8 Oct 2025 13:04:15 +0200 Subject: [PATCH] Add enabled flags for health probes in web and api deployments --- helm/api7ee-demo-k8s/templates/deployment-api.yaml | 10 +++++++--- helm/api7ee-demo-k8s/templates/deployment-web.yaml | 10 +++++++--- helm/api7ee-demo-k8s/values.yaml | 8 ++++++++ 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/helm/api7ee-demo-k8s/templates/deployment-api.yaml b/helm/api7ee-demo-k8s/templates/deployment-api.yaml index 12ab6fa..60bc89d 100644 --- a/helm/api7ee-demo-k8s/templates/deployment-api.yaml +++ b/helm/api7ee-demo-k8s/templates/deployment-api.yaml @@ -39,10 +39,14 @@ spec: - name: http containerPort: {{ .Values.api.service.targetPort }} protocol: TCP + {{- if and .Values.api.healthProbes.enabled .Values.api.livenessProbe.enabled }} livenessProbe: - {{- toYaml .Values.api.livenessProbe | nindent 12 }} + {{- omit .Values.api.livenessProbe "enabled" | toYaml | nindent 12 }} + {{- end }} + {{- if and .Values.api.healthProbes.enabled .Values.api.readinessProbe.enabled }} readinessProbe: - {{- toYaml .Values.api.readinessProbe | nindent 12 }} + {{- omit .Values.api.readinessProbe "enabled" | toYaml | nindent 12 }} + {{- end }} resources: {{- toYaml .Values.api.resources | nindent 12 }} env: @@ -74,4 +78,4 @@ spec: tolerations: {{- toYaml . | nindent 8 }} {{- end }} -{{- end }} \ No newline at end of file +{{- end }} diff --git a/helm/api7ee-demo-k8s/templates/deployment-web.yaml b/helm/api7ee-demo-k8s/templates/deployment-web.yaml index bd60682..7c2609d 100644 --- a/helm/api7ee-demo-k8s/templates/deployment-web.yaml +++ b/helm/api7ee-demo-k8s/templates/deployment-web.yaml @@ -39,10 +39,14 @@ spec: - name: http containerPort: {{ .Values.web.service.targetPort }} protocol: TCP + {{- if and .Values.web.healthProbes.enabled .Values.web.livenessProbe.enabled }} livenessProbe: - {{- toYaml .Values.web.livenessProbe | nindent 12 }} + {{- omit .Values.web.livenessProbe "enabled" | toYaml | nindent 12 }} + {{- end }} + {{- if and .Values.web.healthProbes.enabled .Values.web.readinessProbe.enabled }} readinessProbe: - {{- toYaml .Values.web.readinessProbe | nindent 12 }} + {{- omit .Values.web.readinessProbe "enabled" | toYaml | nindent 12 }} + {{- end }} resources: {{- toYaml .Values.web.resources | nindent 12 }} env: @@ -74,4 +78,4 @@ spec: tolerations: {{- toYaml . | nindent 8 }} {{- end }} -{{- end }} \ No newline at end of file +{{- end }} diff --git a/helm/api7ee-demo-k8s/values.yaml b/helm/api7ee-demo-k8s/values.yaml index 3ffbb52..49de9e3 100644 --- a/helm/api7ee-demo-k8s/values.yaml +++ b/helm/api7ee-demo-k8s/values.yaml @@ -48,7 +48,10 @@ web: env: [] # Liveness and readiness probes + healthProbes: + enabled: true # Set to false to disable both probes livenessProbe: + enabled: true # Set to false to disable liveness probe httpGet: path: /docs port: http @@ -56,6 +59,7 @@ web: periodSeconds: 10 readinessProbe: + enabled: true # Set to false to disable readiness probe httpGet: path: /docs port: http @@ -104,7 +108,10 @@ api: value: "info" # Liveness and readiness probes + healthProbes: + enabled: true # Set to false to disable both probes livenessProbe: + enabled: true # Set to false to disable liveness probe httpGet: path: /health port: http @@ -112,6 +119,7 @@ api: periodSeconds: 10 readinessProbe: + enabled: true # Set to false to disable readiness probe httpGet: path: /ready port: http