Skip to content

Commit

Permalink
add liveness, readiness and startup probes as config
Browse files Browse the repository at this point in the history
  • Loading branch information
kofemann committed Feb 16, 2024
1 parent 9164c94 commit 485fa24
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 13 deletions.
36 changes: 35 additions & 1 deletion templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,38 @@ dCache conf and layout config map
items:
- key: "dcache-k8s-door"
path: "dcache-k8s.conf"
{{- end }}
{{- end }}

{{/*
Readiness probe
*/}}
{{- define "dcache.readiness.probe" }}
readinessProbe:
initialDelaySeconds: {{.Values.readinessProbe.initialDelaySeconds }}
timeoutSeconds: {{.Values.readinessProbe.timeoutSeconds }}
failureThreshold: {{ .Values.readinessProbe.failureThreshold }}
successThreshold: {{ .Values.readinessProbe.successThreshold }}
{{- end }}

{{/*
Liveness probe
*/}}
{{- define "dcache.liveness.probe" }}
livenessProbe:
initialDelaySeconds: {{.Values.livenessProbe.initialDelaySeconds }}
timeoutSeconds: {{.Values.livenessProbe.timeoutSeconds }}
failureThreshold: {{ .Values.livenessProbe.failureThreshold }}
successThreshold: {{ .Values.livenessProbe.successThreshold }}
{{- end }}


{{/*
Startup probe
*/}}
{{- define "dcache.startup.probe" }}
startupProbe:
initialDelaySeconds: {{.Values.startupProbe.initialDelaySeconds }}
timeoutSeconds: {{.Values.startupProbe.timeoutSeconds }}
failureThreshold: {{ .Values.startupProbe.failureThreshold }}
successThreshold: {{ .Values.startupProbe.successThreshold }}
{{- end }}
17 changes: 11 additions & 6 deletions templates/door.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,21 @@ spec:
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
command: ["/run.sh", "door-svc" ]
readinessProbe:
{{- if .Values.readinessProbe.enabled}}
{{ include "dcache.readiness.probe" . | indent 8 }}
tcpSocket:
port: 2049
initialDelaySeconds: 20
timeoutSeconds: 5
livenessProbe:
{{- end}}
{{- if .Values.livenessProbe.enabled}}
{{ include "dcache.liveness.probe" . | indent 8 }}
tcpSocket:
port: 2049
initialDelaySeconds: 90
timeoutSeconds: 5
{{- end}}
{{- if .Values.startupProbe.enabled}}
{{ include "dcache.startup.probe" . | indent 8 }}
tcpSocket:
port: 2049
{{- end}}
volumeMounts:
{{ include "dcache.conf.mounts" . | indent 8 }}
- name: init-scripts
Expand Down
17 changes: 11 additions & 6 deletions templates/pool.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,21 @@ spec:
image: "{{ $.Values.image.repository }}:{{ $.Values.image.tag | default $.Chart.AppVersion }}"
imagePullPolicy: {{ $.Values.image.pullPolicy }}
command: ["/run.sh", "pool-{{ . }}-svc"]
readinessProbe:
{{- if $.Values.readinessProbe.enabled}}
{{ include "dcache.readiness.probe" $ | indent 8 }}
tcpSocket:
port: {{ $.Values.mover.nfs }}
initialDelaySeconds: 20
timeoutSeconds: 5
livenessProbe:
{{- end}}
{{- if $.Values.livenessProbe.enabled}}
{{ include "dcache.liveness.probe" $ | indent 8 }}
tcpSocket:
port: {{ $.Values.mover.nfs }}
initialDelaySeconds: 90
timeoutSeconds: 5
{{- end}}
{{- if $.Values.startupProbe.enabled}}
{{ include "dcache.startup.probe" $ | indent 8 }}
tcpSocket:
port: {{ $.Values.mover.nfs }}
{{- end}}
volumeMounts:
{{ include "dcache.conf.mounts" . | indent 8 }}
- name: certs-store-{{ . }}
Expand Down
30 changes: 30 additions & 0 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,36 @@ cell:
zookeeper:
servers: cells-zookeeper:2181


# liveness, readiness and startup probes

# dCache containers' liveness probe.
livenessProbe:
enabled: true
initialDelaySeconds: 30
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 6
successThreshold: 1

# dCache containers' readiness probe.
readinessProbe:
enabled: true
initialDelaySeconds: 5
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 6
successThreshold: 1

# dCache containers' startup probe.
startupProbe:
enabled: true
initialDelaySeconds: 30
periodSeconds: 10
timeoutSeconds: 1
failureThreshold: 15
successThreshold: 1

#
# dCache doors/services
#
Expand Down

0 comments on commit 485fa24

Please sign in to comment.