Skip to content

Commit

Permalink
feat: allow custom probes for kratos (#481)
Browse files Browse the repository at this point in the history
  • Loading branch information
Demonsthere authored Aug 1, 2022
1 parent e10eb14 commit 3f9821c
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 1 deletion.
25 changes: 25 additions & 0 deletions hacks/values/kratos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,31 @@ deployment:
extraEnv:
- name: FOO
value: BAR
customLivenessProbe:
failureThreshold: 5
exec:
command:
- /bin/sh
- -c
- |-
wget -S http://127.0.0.1:4434/admin/health/ready -O -
initialDelaySeconds: 10
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1
customReadinessProbe:
failureThreshold: 5
exec:
command:
- /bin/sh
- -c
- |-
wget -S http://127.0.0.1:4434/admin/health/ready -O -
initialDelaySeconds: 10
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1


job:
extraContainers: |
Expand Down
8 changes: 8 additions & 0 deletions helm/charts/kratos/templates/deployment-kratos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -188,15 +188,23 @@ spec:
containerPort: {{ .Values.kratos.config.serve.public.port }}
protocol: TCP
livenessProbe:
{{- if .Values.deployment.customLivenessProbe }}
{{- toYaml .Values.deployment.customLivenessProbe | nindent 12 }}
{{- else }}
httpGet:
path: /admin/health/ready
port: {{ .Values.kratos.config.serve.admin.port }}
{{- toYaml .Values.deployment.livenessProbe | nindent 12 }}
{{- end }}
readinessProbe:
{{- if .Values.deployment.customReadinessProbe }}
{{- toYaml .Values.deployment.customReadinessProbe | nindent 12 }}
{{- else }}
httpGet:
path: /admin/health/ready
port: {{ .Values.kratos.config.serve.admin.port }}
{{- toYaml .Values.deployment.readinessProbe | nindent 12 }}
{{- end }}
resources:
{{- toYaml $resources | nindent 12 }}
{{- if .Values.securityContext }}
Expand Down
8 changes: 7 additions & 1 deletion helm/charts/kratos/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -175,16 +175,22 @@ kratos:

# -- Configuration options for the k8s deployment
deployment:
# -- Configure the probes for when the deployment is considered ready and ongoing health check
# -- Configure the livenessProbe parameters
livenessProbe:
initialDelaySeconds: 30
periodSeconds: 10
failureThreshold: 5
# -- Configure the readinessProbe parameters
readinessProbe:
initialDelaySeconds: 30
periodSeconds: 10
failureThreshold: 5

# -- Configure a custom livenessProbe. This overwrites the default object
customLivenessProbe: {}
# -- Configure a custom readinessProbe. This overwrites the default object
customReadinessProbe: {}

# -- Array of extra arguments to be passed down to the deployment. Kubernetes args format is expected
# - --foo
# - --sqa-opt-out
Expand Down

0 comments on commit 3f9821c

Please sign in to comment.