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

Commit

Permalink
fix: probes
Browse files Browse the repository at this point in the history
  • Loading branch information
charlie-haley authored Jan 23, 2024
1 parent f2c7924 commit 617748f
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 52 deletions.
16 changes: 2 additions & 14 deletions templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,21 +82,9 @@ spec:
protocol: TCP
{{- if .Values.http.enabled }}
livenessProbe:
httpGet:
path: /ping
port: http
{{- if and .Values.http.cert_file .Values.http.key_file}}
scheme: HTTPS
{{- end }}
{{- toYaml .Values.deployment.livenessProbe | nindent 14 }}
{{- toYaml .Values.deployment.livenessProbe | nindent 12 }}
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 }}
{{- toYaml .Values.deployment.readinessProbe | nindent 12 }}
{{- end }}
env:
{{- toYaml .Values.env | nindent 12 }}
Expand Down
68 changes: 36 additions & 32 deletions tests/deployment_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,24 @@ tests:
- equal:
path: spec.template.spec.containers[0].livenessProbe
value:
failureThreshold: 3
periodSeconds: 5
successThreshold: 1
timeoutSeconds: 2
httpGet:
failureThreshold: 3
path: /ping
periodSeconds: 5
path: /ping
port: http
successThreshold: 1
timeoutSeconds: 2

- equal:
path: spec.template.spec.containers[0].readinessProbe
value:
failureThreshold: 1
periodSeconds: 5
successThreshold: 1
timeoutSeconds: 2
httpGet:
failureThreshold: 1
path: /ready
periodSeconds: 5
port: http
successThreshold: 1
timeoutSeconds: 2

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

- equal:
path: spec.template.spec.containers[0].readinessProbe
value:
failureThreshold: 1
periodSeconds: 5
successThreshold: 1
timeoutSeconds: 2
httpGet:
failureThreshold: 1
path: /ready
periodSeconds: 5
port: http
successThreshold: 1
timeoutSeconds: 2

- it: should enable probes custom
set:
Expand All @@ -80,17 +82,19 @@ tests:
periodSeconds: 10
successThreshold: 5
timeoutSeconds: 4
httpHeaders:
- name: My-Header
value: Bar
httpGet:
httpHeaders:
- name: My-Header
value: Bar
readinessProbe:
failureThreshold: 6
periodSeconds: 12
successThreshold: 6
timeoutSeconds: 5
httpHeaders:
- name: My-Header
value: Foo
httpGet:
httpHeaders:
- name: My-Header
value: Foo
http:
enabled: true
address: "127.0.0.1:5555"
Expand All @@ -104,26 +108,26 @@ tests:
- equal:
path: spec.template.spec.containers[0].livenessProbe
value:
failureThreshold: 5
periodSeconds: 10
successThreshold: 5
timeoutSeconds: 4
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:
successThreshold: 6
timeoutSeconds: 5
periodSeconds: 12
failureThreshold: 6
httpGet:
failureThreshold: 6
path: /ready
periodSeconds: 12
port: http
successThreshold: 6
timeoutSeconds: 5
httpHeaders:
- name: My-Header
value: Foo
Expand Down
20 changes: 14 additions & 6 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,25 @@ deployment:
periodSeconds: 5
successThreshold: 1
timeoutSeconds: 2
# httpHeaders:
# - name: My-Header
# value: Bar
httpGet:
path: /ping
port: http
# scheme: HTTPS
# httpHeaders:
# - name: My-Header
# value: Bar
livenessProbe:
failureThreshold: 3
periodSeconds: 5
successThreshold: 1
timeoutSeconds: 2
# httpHeaders:
# - name: My-Header
# value: Bar
httpGet:
path: /ready
port: http
# scheme: HTTPS
# httpHeaders:
# - name: My-Header
# value: Bar

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

0 comments on commit 617748f

Please sign in to comment.