Skip to content

Commit 9faff4a

Browse files
authored
Add customizable liveness and readiness probes (#99)
1 parent c5cedf1 commit 9faff4a

File tree

2 files changed

+35
-7
lines changed

2 files changed

+35
-7
lines changed

deploy/helm-chart/kubernetes-secret-generator/templates/deployment.yaml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,18 +41,28 @@ spec:
4141
ports:
4242
- containerPort: 8080
4343
name: healthcheck
44+
{{- if .Values.livenessProbe.enabled }}
4445
livenessProbe:
4546
httpGet:
4647
path: /healthz
4748
port: healthcheck
48-
initialDelaySeconds: 6
49-
periodSeconds: 3
49+
initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }}
50+
periodSeconds: {{ .Values.livenessProbe.periodSeconds }}
51+
timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }}
52+
successThreshold: {{ .Values.livenessProbe.successThreshold }}
53+
failureThreshold: {{ .Values.livenessProbe.failureThreshold }}
54+
{{- end }}
55+
{{- if .Values.readinessProbe.enabled }}
5056
readinessProbe:
5157
httpGet:
5258
path: /readyz
5359
port: healthcheck
54-
initialDelaySeconds: 6
55-
periodSeconds: 3
60+
initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }}
61+
periodSeconds: {{ .Values.readinessProbe.periodSeconds }}
62+
timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }}
63+
successThreshold: {{ .Values.readinessProbe.successThreshold }}
64+
failureThreshold: {{ .Values.readinessProbe.failureThreshold }}
65+
{{- end }}
5666
env:
5767
- name: WATCH_NAMESPACE
5868
value: {{ template "kubernetes-secret-generator.watchNamespace" . }}

deploy/helm-chart/kubernetes-secret-generator/values.yaml

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,23 @@ serviceAccount:
2727
# If not set and create is true, a name is generated using the fullname template
2828
name:
2929

30-
podSecurityContext: {}
30+
podSecurityContext:
31+
{}
3132
# fsGroup: 2000
3233

3334
priorityClassName: ""
3435

35-
securityContext: {}
36+
securityContext:
37+
{}
3638
# capabilities:
3739
# drop:
3840
# - ALL
3941
# readOnlyRootFilesystem: true
4042
# runAsNonRoot: true
4143
# runAsUser: 1000
4244

43-
resources: {}
45+
resources:
46+
{}
4447
# limits:
4548
# cpu: 100m
4649
# memory: 128Mi
@@ -83,3 +86,18 @@ rbac:
8386
# ClusterRole is deployed by Default
8487
clusterRole: true
8588

89+
livenessProbe:
90+
enabled: true
91+
initialDelaySeconds: 6
92+
periodSeconds: 3
93+
timeoutSeconds: 1
94+
successThreshold: 1
95+
failureThreshold: 3
96+
97+
readinessProbe:
98+
enabled: true
99+
initialDelaySeconds: 6
100+
periodSeconds: 3
101+
timeoutSeconds: 1
102+
successThreshold: 1
103+
failureThreshold: 3

0 commit comments

Comments
 (0)