diff --git a/charts/simple-app/CHANGELOG.md b/charts/simple-app/CHANGELOG.md index 7cfce25..e23db3d 100644 --- a/charts/simple-app/CHANGELOG.md +++ b/charts/simple-app/CHANGELOG.md @@ -1,3 +1,7 @@ +# 1.5.0 + +* Add `startupProbe` support with `global.startupProbe` fallback + # 1.4.2 * Allow extra/unknown values (e.g. `enabled`) without schema validation errors diff --git a/charts/simple-app/Chart.yaml b/charts/simple-app/Chart.yaml index 16e9268..d5b5fcf 100644 --- a/charts/simple-app/Chart.yaml +++ b/charts/simple-app/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: "1.4.2" +version: "1.5.0" # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/simple-app/templates/deployment.yaml b/charts/simple-app/templates/deployment.yaml index 7f7f93b..fabd50b 100644 --- a/charts/simple-app/templates/deployment.yaml +++ b/charts/simple-app/templates/deployment.yaml @@ -4,6 +4,7 @@ {{- $probePath := $probe.path | default "/" -}} {{- $livenessProbe := .Values.livenessProbe | default .Values.global.livenessProbe | default dict -}} {{- $readinessProbe := .Values.readinessProbe | default .Values.global.readinessProbe | default dict -}} +{{- $startupProbe := .Values.startupProbe | default .Values.global.startupProbe | default dict -}} {{- $autoscaling := .Values.autoscaling | default .Values.global.autoscaling | default dict -}} {{- $replicaCount := .Values.replicaCount | default .Values.global.replicaCount | default 1 -}} @@ -111,6 +112,10 @@ spec: path: {{ $probePath }} port: http {{- end }} + {{- if $startupProbe }} + startupProbe: + {{- toYaml $startupProbe | nindent 12 }} + {{- end }} {{- include "simple-charts-common.resources" . | nindent 10 }} volumeMounts: {{- if .Values.shmSize }} diff --git a/charts/simple-app/tests/simple_test.yaml b/charts/simple-app/tests/simple_test.yaml index f98aad5..a7a02b5 100644 --- a/charts/simple-app/tests/simple_test.yaml +++ b/charts/simple-app/tests/simple_test.yaml @@ -338,3 +338,32 @@ tests: matchLabels: app.kubernetes.io/instance: simple app.kubernetes.io/name: simple-app + + - it: Deployment should not have startupProbe by default + template: deployment.yaml + asserts: + - isKind: + of: Deployment + - notExists: + path: spec.template.spec.containers[0].startupProbe + + - it: Deployment should set startupProbe when specified + template: deployment.yaml + set: + startupProbe: + httpGet: + path: /healthz + port: http + failureThreshold: 30 + periodSeconds: 10 + asserts: + - isKind: + of: Deployment + - equal: + path: spec.template.spec.containers[0].startupProbe.httpGet + value: + path: /healthz + port: http + - equal: + path: spec.template.spec.containers[0].startupProbe.failureThreshold + value: 30 diff --git a/charts/simple-app/values.schema.json b/charts/simple-app/values.schema.json index a99e6f0..07a674d 100644 --- a/charts/simple-app/values.schema.json +++ b/charts/simple-app/values.schema.json @@ -223,6 +223,9 @@ "readinessProbe": { "type": "object" }, + "startupProbe": { + "type": "object" + }, "replicaCount": { "oneOf": [ { diff --git a/charts/simple-app/values.yaml b/charts/simple-app/values.yaml index b495d77..97cc608 100644 --- a/charts/simple-app/values.yaml +++ b/charts/simple-app/values.yaml @@ -150,6 +150,16 @@ readinessProbe: {} # successThreshold: 1 # failureThreshold: 3 +startupProbe: {} + # httpGet: + # path: / + # port: http + # initialDelaySeconds: 0 + # timeoutSeconds: 1 + # periodSeconds: 10 + # successThreshold: 1 + # failureThreshold: 30 + # Defaults to global.replicaCount or 1 replicaCount: @@ -296,6 +306,7 @@ global: {} # probe: {} # livenessProbe: {} # readinessProbe: {} + # startupProbe: {} # replicaCount: # resources: {} # autoscaling: {} diff --git a/charts/simple-worker/CHANGELOG.md b/charts/simple-worker/CHANGELOG.md index 9f77e71..c93973d 100644 --- a/charts/simple-worker/CHANGELOG.md +++ b/charts/simple-worker/CHANGELOG.md @@ -1,3 +1,8 @@ +# 1.5.0 + +* Add `startupProbe` support with `global.startupProbe` fallback +* Make `livenessProbe` and `readinessProbe` configurable via values (default behaviour unchanged: `exec: echo ok`) + # 1.4.2 * Allow extra/unknown values (e.g. `enabled`) without schema validation errors diff --git a/charts/simple-worker/Chart.yaml b/charts/simple-worker/Chart.yaml index 4f3b15f..e95fc5c 100644 --- a/charts/simple-worker/Chart.yaml +++ b/charts/simple-worker/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: "1.4.2" +version: "1.5.0" # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/simple-worker/templates/deployment.yaml b/charts/simple-worker/templates/deployment.yaml index b3b3d7f..c1fd151 100644 --- a/charts/simple-worker/templates/deployment.yaml +++ b/charts/simple-worker/templates/deployment.yaml @@ -1,6 +1,9 @@ {{- $fullName := include "simple-charts-common.fullname" . -}} {{- $autoscaling := .Values.autoscaling | default .Values.global.autoscaling | default dict -}} {{- $replicaCount := .Values.replicaCount | default .Values.global.replicaCount | default 1 -}} +{{- $livenessProbe := .Values.livenessProbe | default .Values.global.livenessProbe | default dict -}} +{{- $readinessProbe := .Values.readinessProbe | default .Values.global.readinessProbe | default dict -}} +{{- $startupProbe := .Values.startupProbe | default .Values.global.startupProbe | default dict -}} apiVersion: apps/v1 kind: Deployment @@ -70,15 +73,27 @@ spec: {{ end }} {{- include "simple-charts-common.env" . | nindent 10 }} livenessProbe: + {{- if $livenessProbe }} + {{- toYaml $livenessProbe | nindent 12 }} + {{- else }} exec: command: - echo - ok + {{- end }} readinessProbe: + {{- if $readinessProbe }} + {{- toYaml $readinessProbe | nindent 12 }} + {{- else }} exec: command: - echo - ok + {{- end }} + {{- if $startupProbe }} + startupProbe: + {{- toYaml $startupProbe | nindent 12 }} + {{- end }} {{- include "simple-charts-common.resources" . | nindent 10 }} volumeMounts: {{- if .Values.shmSize }} diff --git a/charts/simple-worker/tests/simple_test.yaml b/charts/simple-worker/tests/simple_test.yaml index a8f2af2..f6db909 100644 --- a/charts/simple-worker/tests/simple_test.yaml +++ b/charts/simple-worker/tests/simple_test.yaml @@ -181,3 +181,34 @@ tests: asserts: - hasDocuments: count: 0 + + - it: Deployment should not have startupProbe by default + template: deployment.yaml + asserts: + - isKind: + of: Deployment + - notExists: + path: spec.template.spec.containers[0].startupProbe + + - it: Deployment should set startupProbe when specified + template: deployment.yaml + set: + startupProbe: + exec: + command: + - cat + - /tmp/ready + failureThreshold: 30 + periodSeconds: 10 + asserts: + - isKind: + of: Deployment + - equal: + path: spec.template.spec.containers[0].startupProbe.exec.command + value: + - cat + - /tmp/ready + - equal: + path: spec.template.spec.containers[0].startupProbe.failureThreshold + value: 30 + diff --git a/charts/simple-worker/values.schema.json b/charts/simple-worker/values.schema.json index a0296bd..1580ffa 100644 --- a/charts/simple-worker/values.schema.json +++ b/charts/simple-worker/values.schema.json @@ -4,7 +4,10 @@ "type": "object", "properties": { "global": { - "type": ["object", "null"] + "type": [ + "object", + "null" + ] }, "nameOverride": { "type": "string" @@ -175,6 +178,9 @@ "readinessProbe": { "type": "object" }, + "startupProbe": { + "type": "object" + }, "replicaCount": { "oneOf": [ { diff --git a/charts/simple-worker/values.yaml b/charts/simple-worker/values.yaml index e03ffcf..2f581d4 100644 --- a/charts/simple-worker/values.yaml +++ b/charts/simple-worker/values.yaml @@ -78,6 +78,36 @@ configs: [] # Defaults to global.replicaCount or 1 replicaCount: +livenessProbe: {} + # exec: + # command: + # - echo + # - ok + # initialDelaySeconds: 5 + # timeoutSeconds: 1 + # periodSeconds: 10 + # failureThreshold: 3 + +readinessProbe: {} + # exec: + # command: + # - echo + # - ok + # initialDelaySeconds: 5 + # timeoutSeconds: 1 + # periodSeconds: 10 + # failureThreshold: 3 + +startupProbe: {} + # exec: + # command: + # - echo + # - ok + # initialDelaySeconds: 0 + # timeoutSeconds: 1 + # periodSeconds: 10 + # failureThreshold: 30 + serviceAccount: {} ## Specifies whether a service account should be created # create: true @@ -133,6 +163,9 @@ global: {} # hostAliases: [] # env: [] # replicaCount: + # livenessProbe: {} + # readinessProbe: {} + # startupProbe: {} # resources: {} # autoscaling: {} # nodeSelector: {}