Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add extra config for probes #75

Merged
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
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