Skip to content

Commit

Permalink
Add option to override initialDelay and period (rancher#39319)
Browse files Browse the repository at this point in the history
Adds values to the chart for rancher server to override the
livenessProbe and readinessProbe's initialDelaySeconds and periodSeconds
  • Loading branch information
Steffan Tucker committed Nov 8, 2022
1 parent 08bf3fe commit 57adc29
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 0 deletions.
16 changes: 16 additions & 0 deletions chart/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -147,14 +147,30 @@ spec:
httpGet:
path: /healthz
port: 80
{{- if .Values.livenessProbe.initialDelaySeconds }}
initialDelaySeconds: {{.Values.livenessProbe.initialDelaySeconds}}
{{- else }}
initialDelaySeconds: 60
{{- end }}
{{- if .Values.livenessProbe.periodSeconds }}
periodSeconds: {{ .Values.livenessProbe.periodSeconds }}
{{- else }}
periodSeconds: 30
{{- end }}
readinessProbe:
httpGet:
path: /healthz
port: 80
{{- if .Values.readinessProbe.initialDelaySeconds }}
initialDelaySeconds: {{.Values.readinessProbe.initialDelaySeconds}}
{{- else }}
initialDelaySeconds: 5
{{- end }}
{{- if .Values.readinessProbe.periodSeconds }}
periodSeconds: {{ .Values.readinessProbe.periodSeconds }}
{{- else }}
periodSeconds: 30
{{- end }}
resources:
{{ toYaml .Values.resources | indent 10 }}
volumeMounts:
Expand Down
48 changes: 48 additions & 0 deletions chart/tests/deployment_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -349,3 +349,51 @@ tests:
- equal:
path: spec.template.spec.priorityClassName
value: "rancher-critical"
- it: should default livenessProbe initialDelaySeconds to 60
asserts:
- equal:
path: spec.template.spec.containers[0].livenessProbe.initialDelaySeconds
value: 60
- it: should default livenessProbe periodSeconds to 30
asserts:
- equal:
path: spec.template.spec.containers[0].livenessProbe.periodSeconds
value: 30
- it: should default readinessProbe initialDelaySeconds to 5
asserts:
- equal:
path: spec.template.spec.containers[0].readinessProbe.initialDelaySeconds
value: 5
- it: should default readinessProbe periodSeconds to 30
asserts:
- equal:
path: spec.template.spec.containers[0].readinessProbe.periodSeconds
value: 30
- it: should set livenessProbe initialDelaySeconds to 90
set:
livenessProbe.initialDelaySeconds: 90
asserts:
- equal:
path: spec.template.spec.containers[0].livenessProbe.initialDelaySeconds
value: 90
- it: should set livenessProbe periodSeconds to 60
set:
livenessProbe.periodSeconds: 60
asserts:
- equal:
path: spec.template.spec.containers[0].livenessProbe.periodSeconds
value: 60
- it: should set readinessProbe initialDelaySeconds to 20
set:
readinessProbe.initialDelaySeconds: 20
asserts:
- equal:
path: spec.template.spec.containers[0].readinessProbe.initialDelaySeconds
value: 20
- it: should set readinessProbe periodSeconds to 60
set:
readinessProbe.periodSeconds: 60
asserts:
- equal:
path: spec.template.spec.containers[0].readinessProbe.periodSeconds
value: 60
7 changes: 7 additions & 0 deletions chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -161,3 +161,10 @@ postDelete:

# Set a bootstrap password. If leave empty, a random password will be generated.
bootstrapPassword: ""

livenessProbe:
initialDelaySeconds: 60
periodSeconds: 30
readinessProbe:
initialDelaySeconds: 5
periodSeconds: 30

0 comments on commit 57adc29

Please sign in to comment.