Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions charts/simple-app/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion charts/simple-app/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions charts/simple-app/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 -}}

Expand Down Expand Up @@ -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 }}
Expand Down
29 changes: 29 additions & 0 deletions charts/simple-app/tests/simple_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 3 additions & 0 deletions charts/simple-app/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,9 @@
"readinessProbe": {
"type": "object"
},
"startupProbe": {
"type": "object"
},
"replicaCount": {
"oneOf": [
{
Expand Down
11 changes: 11 additions & 0 deletions charts/simple-app/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down Expand Up @@ -296,6 +306,7 @@ global: {}
# probe: {}
# livenessProbe: {}
# readinessProbe: {}
# startupProbe: {}
# replicaCount:
# resources: {}
# autoscaling: {}
Expand Down
5 changes: 5 additions & 0 deletions charts/simple-worker/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion charts/simple-worker/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 15 additions & 0 deletions charts/simple-worker/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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 }}
Expand Down
31 changes: 31 additions & 0 deletions charts/simple-worker/tests/simple_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

8 changes: 7 additions & 1 deletion charts/simple-worker/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
"type": "object",
"properties": {
"global": {
"type": ["object", "null"]
"type": [
"object",
"null"
]
},
"nameOverride": {
"type": "string"
Expand Down Expand Up @@ -175,6 +178,9 @@
"readinessProbe": {
"type": "object"
},
"startupProbe": {
"type": "object"
},
"replicaCount": {
"oneOf": [
{
Expand Down
33 changes: 33 additions & 0 deletions charts/simple-worker/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -133,6 +163,9 @@ global: {}
# hostAliases: []
# env: []
# replicaCount:
# livenessProbe: {}
# readinessProbe: {}
# startupProbe: {}
# resources: {}
# autoscaling: {}
# nodeSelector: {}
Expand Down
Loading