From c2897d572ed9b515abadabfefbddb08db812155e Mon Sep 17 00:00:00 2001 From: Amir Alavi Date: Thu, 25 Jan 2024 09:57:41 -0500 Subject: [PATCH] feat: `startupProbe` to avoid a long initial delay seconds for liveness probe Signed-off-by: Amir Alavi --- charts/opencost/Chart.yaml | 2 +- charts/opencost/templates/deployment.yaml | 9 +++++++++ charts/opencost/values.yaml | 18 +++++++++++++++--- 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/charts/opencost/Chart.yaml b/charts/opencost/Chart.yaml index 8b905a1..17dbe3f 100755 --- a/charts/opencost/Chart.yaml +++ b/charts/opencost/Chart.yaml @@ -9,7 +9,7 @@ keywords: - kubecost - opencost - monitoring -version: 1.29.0 +version: 1.29.1 maintainers: - name: mattray - name: toscott diff --git a/charts/opencost/templates/deployment.yaml b/charts/opencost/templates/deployment.yaml index f44a1bf..3b768f2 100644 --- a/charts/opencost/templates/deployment.yaml +++ b/charts/opencost/templates/deployment.yaml @@ -62,6 +62,15 @@ spec: - containerPort: {{ .Values.opencost.exporter.apiPort }} name: http resources: {{- toYaml .Values.opencost.exporter.resources | nindent 12 }} + {{- if .Values.opencost.exporter.startupProbe.enabled }} + startupProbe: + httpGet: + path: {{ .Values.opencost.exporter.startupProbe.path }} + port: {{ .Values.opencost.exporter.apiPort }} + initialDelaySeconds: {{ .Values.opencost.exporter.startupProbe.initialDelaySeconds }} + periodSeconds: {{ .Values.opencost.exporter.startupProbe.periodSeconds }} + failureThreshold: {{ .Values.opencost.exporter.startupProbe.failureThreshold }} + {{- end }} {{- if .Values.opencost.exporter.livenessProbe.enabled }} livenessProbe: httpGet: diff --git a/charts/opencost/values.yaml b/charts/opencost/values.yaml index 98c95be..b6271d1 100644 --- a/charts/opencost/values.yaml +++ b/charts/opencost/values.yaml @@ -114,6 +114,18 @@ opencost: limits: cpu: '999m' memory: '1Gi' + # Startup probe configuration + startupProbe: + # -- Whether probe is enabled + enabled: true + # -- Probe path + path: /healthz + # -- Number of seconds before probe is initiated + initialDelaySeconds: 10 + # -- Probe frequency in seconds + periodSeconds: 5 + # -- Number of failures for probe to be considered failed + failureThreshold: 30 # Liveness probe configuration livenessProbe: # -- Whether probe is enabled @@ -121,9 +133,9 @@ opencost: # -- Probe path path: /healthz # -- Number of seconds before probe is initiated - initialDelaySeconds: 120 + initialDelaySeconds: 10 # -- Probe frequency in seconds - periodSeconds: 10 + periodSeconds: 20 # -- Number of failures for probe to be considered failed failureThreshold: 3 # Readiness probe configuration @@ -133,7 +145,7 @@ opencost: # -- Probe path path: /healthz # -- Number of seconds before probe is initiated - initialDelaySeconds: 120 + initialDelaySeconds: 10 # -- Probe frequency in seconds periodSeconds: 10 # -- Number of failures for probe to be considered failed