Skip to content

Commit 835a4af

Browse files
committed
feat(chart): add probe configuration to helm
Signed-off-by: Oliver Bähler <[email protected]>
1 parent 3229860 commit 835a4af

File tree

3 files changed

+54
-11
lines changed

3 files changed

+54
-11
lines changed

charts/capsule-proxy/README.md

+5
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ If you only need to make minor customizations, you can specify them on the comma
100100
| crds.keep | bool | `true` | Keep the CustomResourceDefinitions (when the chart is deleted) |
101101
| daemonset.hostNetwork | bool | `false` | Use the host network namespace for capsule-proxy pod. |
102102
| daemonset.hostPort | bool | `false` | Binding the capsule-proxy listening port to the host port. |
103+
| env | list | `[]` | Additional environment variables |
103104
| hostNetwork | bool | `false` | When deployed as DaemonSet use |
104105
| image.pullPolicy | string | `"IfNotPresent"` | Set the image pull policy. |
105106
| image.registry | string | `"ghcr.io"` | Set the image registry for capsule-proxy |
@@ -121,11 +122,13 @@ If you only need to make minor customizations, you can specify them on the comma
121122
| jobs.topologySpreadConstraints | list | `[]` | Set Topology Spread Constraints |
122123
| jobs.ttlSecondsAfterFinished | int | `60` | Sets the ttl in seconds after a finished certgen job is deleted. Set to -1 to never delete. |
123124
| kind | string | `"Deployment"` | Set the deployment mode of the capsule-proxy as `Deployment` or `DaemonSet`. |
125+
| livenessProbe | object | `{"enabled":true,"httpGet":{"path":"/healthz/","port":"probe","scheme":"HTTP"},"initialDelaySeconds":20}` | Proxy Liveness-Probe |
124126
| nodeSelector | object | `{}` | Set the node selector for the capsule-proxy pod. |
125127
| podAnnotations | object | `{}` | Annotations to add to the capsule-proxy pod. |
126128
| podLabels | object | `{}` | Labels to add to the capsule-proxy pod. |
127129
| podSecurityContext | object | `{"seccompProfile":{"type":"RuntimeDefault"}}` | Security context for the capsule-proxy pod. |
128130
| priorityClassName | string | `""` | Specifies PriorityClass of the capsule-proxy pod. |
131+
| readinessProbe | object | `{"enabled":true,"httpGet":{"path":"/readyz/","port":"probe","scheme":"HTTP"},"initialDelaySeconds":5}` | Proxy Readyness-Probe |
129132
| replicaCount | int | `1` | Set the replica count for capsule-proxy pod. |
130133
| resources.limits.cpu | string | `"200m"` | Set the CPU requests assigned to the controller. |
131134
| resources.limits.memory | string | `"128Mi"` | Set the memory requests assigned to the controller. |
@@ -138,6 +141,8 @@ If you only need to make minor customizations, you can specify them on the comma
138141
| serviceAccount.name | string | `capsule-proxy`` | The name of the service account to use. If not set and `serviceAccount.create=true`, a name is generated using the fullname template |
139142
| tolerations | list | `[]` | Set list of tolerations for the capsule-proxy pod. |
140143
| topologySpreadConstraints | list | `[]` | Topology Spread Constraints for the capsule-proxy pod. |
144+
| volumeMounts | list | `[]` | Additional volume mounts |
145+
| volumes | list | `[]` | Additional volumes |
141146

142147
### Controller Options Parameters
143148

charts/capsule-proxy/templates/_pod.tpl

+19-11
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,11 @@ spec:
2424
securityContext:
2525
{{- toYaml .Values.podSecurityContext | nindent 4 }}
2626
priorityClassName: {{ .Values.priorityClassName }}
27-
{{- if .Values.options.enableSSL }}
2827
volumes:
28+
{{- with .Values.volumes }}
29+
{{- toYaml . | nindent 2 }}
30+
{{- end }}
31+
{{- if .Values.options.enableSSL }}
2932
- name: certs
3033
secret:
3134
secretName: {{ .Values.options.certificateVolumeName | default (include "capsule-proxy.fullname" .) }}
@@ -61,6 +64,10 @@ spec:
6164
{{- with .Values.options.extraArgs }}
6265
{{- toYaml . | nindent 4 }}
6366
{{- end }}
67+
{{- with .Values.env }}
68+
env:
69+
{{- toYaml . | nindent 4 }}
70+
{{- end }}
6471
ports:
6572
- name: proxy
6673
protocol: TCP
@@ -76,20 +83,21 @@ spec:
7683
- name: probe
7784
containerPort: 8081
7885
protocol: TCP
79-
readinessProbe:
80-
httpGet:
81-
path: /readyz/
82-
port: probe
83-
scheme: HTTP
86+
{{- if .Values.livenessProbe.enabled }}
8487
livenessProbe:
85-
httpGet:
86-
path: /healthz/
87-
port: probe
88-
scheme: HTTP
88+
{{- toYaml (omit .Values.livenessProbe "enabled") | nindent 6 }}
89+
{{- end }}
90+
{{- if .Values.readinessProbe.enabled }}
91+
readinessProbe:
92+
{{- toYaml (omit .Values.readinessProbe "enabled") | nindent 6 }}
93+
{{- end }}
8994
resources:
9095
{{- toYaml .Values.resources | nindent 12 }}
91-
{{- if .Values.options.enableSSL }}
9296
volumeMounts:
97+
{{- with .Values.volumeMounts }}
98+
{{- toYaml . | nindent 4 }}
99+
{{- end }}
100+
{{- if .Values.options.enableSSL }}
93101
- mountPath: {{ .Values.options.SSLDirectory }}
94102
name: certs
95103
{{- end }}

charts/capsule-proxy/values.yaml

+30
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,24 @@ topologySpreadConstraints: []
7373
# matchLabels:
7474
# app.kubernetes.io/name: capsule-proxy
7575

76+
# -- Proxy Readyness-Probe
77+
readinessProbe:
78+
enabled: true
79+
initialDelaySeconds: 5
80+
httpGet:
81+
path: /readyz/
82+
port: probe
83+
scheme: HTTP
84+
85+
# -- Proxy Liveness-Probe
86+
livenessProbe:
87+
enabled: true
88+
initialDelaySeconds: 20
89+
httpGet:
90+
path: /healthz/
91+
port: probe
92+
scheme: HTTP
93+
7694
# Set a pod priorityClassName
7795
# priorityClassName: system-node-critical
7896
# -- Specifies PriorityClass of the capsule-proxy pod.
@@ -106,6 +124,16 @@ resources:
106124
# -- Set the memory limits assigned to the controller.
107125
memory: 128Mi
108126

127+
# -- Additional environment variables
128+
env: []
129+
130+
# -- Additional volumes
131+
volumes: []
132+
133+
# -- Additional volume mounts
134+
volumeMounts: []
135+
136+
109137
# Controller Options
110138
options:
111139
# -- Set the listening port of the capsule-proxy
@@ -144,6 +172,8 @@ options:
144172
clientConnectionBurst: 30
145173
# -- A list of extra arguments to add to the capsule-proxy.
146174
extraArgs: []
175+
# -"--feature-gates=ProxyClusterScoped=true"
176+
# -"--feature-gates=ProxyAllNamespaced=true"
147177

148178
jobs:
149179
certs:

0 commit comments

Comments
 (0)