Skip to content
This repository has been archived by the owner on Jan 6, 2025. It is now read-only.

Commit

Permalink
feat: add extra config for probes (#75)
Browse files Browse the repository at this point in the history
Signed-off-by: Charlie Haley <[email protected]>
  • Loading branch information
charlie-haley authored Jan 22, 2024
1 parent 1ed9036 commit d0efaff
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 0 deletions.
2 changes: 2 additions & 0 deletions templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,15 @@ spec:
{{- if and .Values.http.cert_file .Values.http.key_file}}
scheme: HTTPS
{{- end }}
{{- toYaml .Values.deployment.livenessProbe | nindent 14 }}
readinessProbe:
httpGet:
path: /ready
port: http
{{- if and .Values.http.cert_file .Values.http.key_file}}
scheme: HTTPS
{{- end }}
{{- toYaml .Values.deployment.readinessProbe | nindent 14 }}
{{- end }}
env:
{{- toYaml .Values.env | nindent 12 }}
Expand Down
73 changes: 73 additions & 0 deletions tests/deployment_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,22 @@ tests:
path: spec.template.spec.containers[0].livenessProbe
value:
httpGet:
failureThreshold: 3
path: /ping
periodSeconds: 5
port: http
successThreshold: 1
timeoutSeconds: 2
- equal:
path: spec.template.spec.containers[0].readinessProbe
value:
httpGet:
failureThreshold: 1
path: /ready
periodSeconds: 5
port: http
successThreshold: 1
timeoutSeconds: 2

- it: should enable http custom
set:
Expand All @@ -46,14 +54,79 @@ tests:
path: spec.template.spec.containers[0].livenessProbe
value:
httpGet:
failureThreshold: 3
path: /ping
periodSeconds: 5
port: http
successThreshold: 1
timeoutSeconds: 2
- equal:
path: spec.template.spec.containers[0].readinessProbe
value:
httpGet:
failureThreshold: 1
path: /ready
periodSeconds: 5
port: http
successThreshold: 1
timeoutSeconds: 2

- it: should enable probes custom
set:
deployment:
rolloutConfigMap: false
livenessProbe:
failureThreshold: 5
periodSeconds: 10
successThreshold: 5
timeoutSeconds: 4
httpHeaders:
- name: My-Header
value: Bar
readinessProbe:
failureThreshold: 6
periodSeconds: 12
successThreshold: 6
timeoutSeconds: 5
httpHeaders:
- name: My-Header
value: Foo
http:
enabled: true
address: "127.0.0.1:5555"
asserts:
- equal:
path: spec.template.spec.containers[0].ports
value:
- containerPort: 5555
name: http
protocol: TCP
- equal:
path: spec.template.spec.containers[0].livenessProbe
value:
httpGet:
failureThreshold: 5
path: /ping
periodSeconds: 10
port: http
successThreshold: 5
timeoutSeconds: 4
httpHeaders:
- name: My-Header
value: Bar
- equal:
path: spec.template.spec.containers[0].readinessProbe
value:
httpGet:
failureThreshold: 6
path: /ready
periodSeconds: 12
port: http
successThreshold: 6
timeoutSeconds: 5
httpHeaders:
- name: My-Header
value: Foo

- it: should enable streams
set:
Expand Down
17 changes: 17 additions & 0 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,23 @@ deployment:
# Rollout the deployment on ConfigMap changes
rolloutConfigMap: true

readinessProbe:
failureThreshold: 1
periodSeconds: 5
successThreshold: 1
timeoutSeconds: 2
# httpHeaders:
# - name: My-Header
# value: Bar
livenessProbe:
failureThreshold: 3
periodSeconds: 5
successThreshold: 1
timeoutSeconds: 2
# httpHeaders:
# - name: My-Header
# value: Bar

# commonLabels -- Add additional labels to all created resources.
commonLabels: {}

Expand Down

0 comments on commit d0efaff

Please sign in to comment.