diff --git a/chart-tests/application/ci/test-image-lifecycle-values.yaml b/chart-tests/application/ci/test-image-lifecycle-values.yaml index 6ac0535..02d0a36 100644 --- a/chart-tests/application/ci/test-image-lifecycle-values.yaml +++ b/chart-tests/application/ci/test-image-lifecycle-values.yaml @@ -17,6 +17,9 @@ lifecycle: preStop: exec: command: ["/bin/sh", "-c", "echo exiting"] +startupProbe: + enabled: true + cmd: ['ls'] livenessProbe: cmd: ['ls'] readinessProbe: diff --git a/chart-tests/application/ci/test-sidecar-values.yaml b/chart-tests/application/ci/test-sidecar-values.yaml index d9b0c82..daa9799 100644 --- a/chart-tests/application/ci/test-sidecar-values.yaml +++ b/chart-tests/application/ci/test-sidecar-values.yaml @@ -18,6 +18,10 @@ sidecars: env: ECHO_VALUE: yehaaa QUARKUS_HTTP_PORT: 9090 + startupProbe: + enabled: true + path: /.well-known/live + port: 9090 livenessProbe: path: /.well-known/live port: 9090 @@ -39,6 +43,10 @@ sidecars: env: ECHO_VALUE: wohooo QUARKUS_HTTP_PORT: 7070 + startupProbe: + enabled: true + path: /.well-known/live + port: 7070 livenessProbe: path: /.well-known/live port: 7070 diff --git a/chart-tests/application/ci/test-liveness-readiness-with-cmd.yaml b/chart-tests/application/ci/test-startup-liveness-readiness-with-cmd.yaml similarity index 62% rename from chart-tests/application/ci/test-liveness-readiness-with-cmd.yaml rename to chart-tests/application/ci/test-startup-liveness-readiness-with-cmd.yaml index b0a3681..bbbc036 100644 --- a/chart-tests/application/ci/test-liveness-readiness-with-cmd.yaml +++ b/chart-tests/application/ci/test-startup-liveness-readiness-with-cmd.yaml @@ -1,3 +1,7 @@ +startupProbe: + enabled: true + cmd: ['curl', '-f', 'http://localhost:8080/.well-known/live'] + livenessProbe: cmd: ['curl', '-f', 'http://localhost:8080/.well-known/live'] diff --git a/chart-tests/application/ci/test-statefulset-sidecar-values.yaml b/chart-tests/application/ci/test-statefulset-sidecar-values.yaml index ae50c50..cde6d8d 100644 --- a/chart-tests/application/ci/test-statefulset-sidecar-values.yaml +++ b/chart-tests/application/ci/test-statefulset-sidecar-values.yaml @@ -21,6 +21,10 @@ sidecars: env: ECHO_VALUE: yehaaa QUARKUS_HTTP_PORT: 9090 + startupProbe: + enabled: true + path: /.well-known/live + port: 9090 livenessProbe: path: /.well-known/live port: 9090 @@ -38,6 +42,10 @@ sidecars: env: ECHO_VALUE: wohooo QUARKUS_HTTP_PORT: 7070 + startupProbe: + enabled: true + path: /.well-known/live + port: 7070 livenessProbe: path: /.well-known/live port: 7070 diff --git a/charts/application/Chart.yaml b/charts/application/Chart.yaml index 7f10e56..a023412 100644 --- a/charts/application/Chart.yaml +++ b/charts/application/Chart.yaml @@ -7,4 +7,4 @@ maintainers: - name: MediaMarktSaturn url: https://github.com/MediaMarktSaturn appVersion: 1.0.0 -version: 1.28.0 +version: 1.29.0 diff --git a/charts/application/templates/_podTemplate.tpl b/charts/application/templates/_podTemplate.tpl index 9df72eb..f9e8bb7 100644 --- a/charts/application/templates/_podTemplate.tpl +++ b/charts/application/templates/_podTemplate.tpl @@ -169,6 +169,24 @@ spec: mountPath: {{ .mountPath }} {{- end }} {{- end }} + {{- if $s.startupProbe }} + startupProbe: + {{- if $s.startupProbe.cmd }} + exec: + command: + {{- range $s.startupProbe.cmd }} + - {{ . | quote }} + {{- end }} + {{ else }} + httpGet: + path: {{ $s.startupProbe.path }} + port: {{ $s.startupProbe.port }} + {{- end }} + initialDelaySeconds: {{ $.Values.startupProbe.initialDelaySeconds }} + periodSeconds: {{ $.Values.startupProbe.periodSeconds }} + failureThreshold: {{ $.Values.startupProbe.failureThreshold }} + timeoutSeconds: {{ $.Values.startupProbe.timeoutSeconds }} + {{- end }} {{- if $s.livenessProbe }} livenessProbe: {{- if $s.livenessProbe.cmd }} @@ -273,6 +291,24 @@ spec: containerPort: {{ $ap.containerPort }} protocol: {{ $ap.protocol }} {{- end }} + {{- if .Values.startupProbe.enabled }} + startupProbe: + {{- if .Values.startupProbe.cmd }} + exec: + command: + {{- range .Values.startupProbe.cmd }} + - {{ . | quote }} + {{- end }} + {{ else }} + httpGet: + path: {{ .Values.startupProbe.path }} + port: {{ .Values.container.port }} + {{- end }} + initialDelaySeconds: {{ .Values.startupProbe.initialDelaySeconds }} + periodSeconds: {{ .Values.startupProbe.periodSeconds }} + failureThreshold: {{ .Values.startupProbe.failureThreshold }} + timeoutSeconds: {{ .Values.startupProbe.timeoutSeconds }} + {{- end }} {{- if .Values.livenessProbe.enabled }} livenessProbe: {{- if .Values.livenessProbe.cmd }} diff --git a/charts/application/values.yaml b/charts/application/values.yaml index 6c275bf..c7277ea 100644 --- a/charts/application/values.yaml +++ b/charts/application/values.yaml @@ -22,6 +22,23 @@ autoscaling: cpu: 80 # memory: 80 +# Check if the container is started +startupProbe: + # Allows to disable the startup probe + enabled: false + path: /.well-known/live + # Use a command to check startup from inside the container, for example ['curl', '-f', 'http://localhost/health/ready']. + # This will take precedence over the given `path` value, if provided. + cmd: [] + # Number of seconds after the container has started before liveness or readiness probes are initiated. + initialDelaySeconds: 10 + # How often (in seconds) to perform the probe. + periodSeconds: 10 + # When a probe fails, Kubernetes will try failureThreshold times before giving up. + failureThreshold: 3 + # Number of seconds after which the probe times out. + timeoutSeconds: 5 + # Check if the container is running livenessProbe: # Allows to disable the liveness probe