Skip to content

Commit d8f6681

Browse files
authored
feat: add support for configuring extra initContainers (#375)
1 parent 801051e commit d8f6681

File tree

6 files changed

+34
-10
lines changed

6 files changed

+34
-10
lines changed

charts/diode/README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,8 @@ helm show values diode/diode
235235
| diodeAuth.config.telemetryTracesExporter | string | `"none"` | telemetry traces exporter |
236236
| diodeAuth.containerPort | int | `8080` | port to listen on |
237237
| diodeAuth.enabled | bool | `true` | enabled |
238-
| diodeAuth.extraEnvs | list | `[]` | extra environment variables to be set on containers' `env` section |
238+
| diodeAuth.extraEnvs | string or list | `[]` | extra environment variables to be set on containers' `env` section |
239+
| diodeAuth.extraInitContainers | string or list | `""` | additional containers to run before auth finishes initializing (may contain templating instructions) |
239240
| diodeAuth.image.imagePullSecrets | list | `[]` | secrets with credentials to pull images from a private registry |
240241
| diodeAuth.image.pullPolicy | string | `"IfNotPresent"` | pull policy |
241242
| diodeAuth.image.repository | string | `"docker.io/netboxlabs/diode-auth"` | image repository |
@@ -250,6 +251,7 @@ helm show values diode/diode
250251
| diodeAuthBootstrap.image.tag | string | `"1.2.0"` | image tag |
251252
| diodeAuthBootstrap.job.annotations | object | `{"helm.sh/hook":"post-install, post-upgrade","helm.sh/hook-weight":"2"}` | annotations to add to the auth bootstrap job |
252253
| diodeAuthBootstrap.job.backoffLimit | int | `20` | backoff limit |
254+
| diodeAuthBootstrap.job.extraInitContainers | string or list | `""` | additional initContainers to run during bootstrap (may contain templating instructions) |
253255
| diodeIngester.annotations | object | `{}` | annotations to add to the ingester deployment |
254256
| diodeIngester.config.loggingLevel | string | `"INFO"` | logging level |
255257
| diodeIngester.config.redisStreamDb | int | `1` | redis stream db |
@@ -260,7 +262,8 @@ helm show values diode/diode
260262
| diodeIngester.containerPort | int | `8081` | port to listen on |
261263
| diodeIngester.enabled | bool | `true` | enabled |
262264
| diodeIngester.existingSecret | string | `"diode-ingester-secret"` | existing secret name |
263-
| diodeIngester.extraEnvs | list | `[]` | extra environment variables to be set on containers' `env` section |
265+
| diodeIngester.extraEnvs | string or list | `[]` | extra environment variables to be set on containers' `env` section |
266+
| diodeIngester.extraInitContainers | string or list | `""` | additional containers to run before the ingester finishes initializing (may contain templating instructions) |
264267
| diodeIngester.grpc.serviceName | string | `"diode.v1.IngesterService"` | grpc service name |
265268
| diodeIngester.image.imagePullSecrets | list | `[]` | secrets with credentials to pull images from a private registry |
266269
| diodeIngester.image.pullPolicy | string | `"IfNotPresent"` | pull policy |
@@ -291,7 +294,8 @@ helm show values diode/diode
291294
| diodeReconciler.containerPort | int | `8081` | port to listen on |
292295
| diodeReconciler.enabled | bool | `true` | enabled |
293296
| diodeReconciler.existingSecret | string | `"diode-reconciler-secret"` | existing secret name |
294-
| diodeReconciler.extraEnvs | list | `[]` | extra environment variables to be set on containers' `env` section |
297+
| diodeReconciler.extraEnvs | string or list | `[]` | extra environment variables to be set on containers' `env` section |
298+
| diodeReconciler.extraInitContainers | string or list | `""` | additional containers to run before the reconciler finishes initializing (may contain templating instructions) |
295299
| diodeReconciler.grpc.serviceName | string | `"diode.v1.ReconcilerService"` | grpc service name |
296300
| diodeReconciler.image.imagePullSecrets | list | `[]` | secrets with credentials to pull images from a private registry |
297301
| diodeReconciler.image.pullPolicy | string | `"IfNotPresent"` | pull policy |
@@ -311,7 +315,7 @@ helm show values diode/diode
311315
| global.diode.hydra | object | `{"waitForPostgres":true}` | hydra additional init containers configuration |
312316
| global.diode.hydra.waitForPostgres | bool | `true` | wait for PostgreSQL |
313317
| hydra | object | `{"deployment":{"extraInitContainers":"{{ include \"diode.hydra.extrainitcontainers\" . }}","resources":{"limits":{"cpu":"500m","memory":"512Mi"},"requests":{"cpu":"100m","memory":"128Mi"}}},"enabled":true,"fullnameOverride":"diode-hydra","hydra":{"automigration":{"enabled":true},"config":{"oidc":{"subject_identifiers":{"supported_types":["public"]}},"strategies":{"access_token":"jwt","jwt":{"scope_claim":"both"}},"ttl":{"access_token":"1h"},"urls":{"self":{"issuer":"http://diode-hydra-public.{{ .Release.Namespace }}.svc.cluster.local:4444"}}},"dev":true,"ingress":{"admin":{"enabled":false},"public":{"enabled":false}},"service":{"admin":{"enabled":true,"port":4445,"type":"ClusterIP"},"public":{"enabled":true,"port":4444,"type":"ClusterIP"}}},"job":{"annotations":{"helm.sh/hook":"post-install, post-upgrade","helm.sh/hook-delete-policy":"hook-succeeded","helm.sh/hook-weight":"1"},"extraInitContainers":"{{ include \"diode.hydra.extrainitcontainers\" . }}"},"secret":{"enabled":false,"nameOverride":"diode-hydra-secret"}}` | ref: https://github.com/ory/k8s/blob/master/helm/charts/hydra/values.yaml |
314-
| hydra.deployment.extraInitContainers | string | `"{{ include \"diode.hydra.extrainitcontainers\" . }}"` | extra init containers |
318+
| hydra.deployment.extraInitContainers | string or list | `"{{ include \"diode.hydra.extrainitcontainers\" . }}"` | extra init containers |
315319
| hydra.deployment.resources | object | `{"limits":{"cpu":"500m","memory":"512Mi"},"requests":{"cpu":"100m","memory":"128Mi"}}` | resources |
316320
| hydra.enabled | bool | `true` | enabled |
317321
| hydra.fullnameOverride | string | `"diode-hydra"` | fullname override |
@@ -332,7 +336,7 @@ helm show values diode/diode
332336
| hydra.hydra.service.public.port | int | `4444` | public service port |
333337
| hydra.hydra.service.public.type | string | `"ClusterIP"` | public service type |
334338
| hydra.job.annotations | object | `{"helm.sh/hook":"post-install, post-upgrade","helm.sh/hook-delete-policy":"hook-succeeded","helm.sh/hook-weight":"1"}` | job annotations |
335-
| hydra.job.extraInitContainers | string | `"{{ include \"diode.hydra.extrainitcontainers\" . }}"` | extra init containers |
339+
| hydra.job.extraInitContainers | string or list | `"{{ include \"diode.hydra.extrainitcontainers\" . }}"` | extra init containers |
336340
| hydra.secret.enabled | bool | `false` | secret enabled |
337341
| hydra.secret.nameOverride | string | `"diode-hydra-secret"` | existing secret name |
338342
| ingressNginx | object | `{"annotations":{},"controller":{"allowSnippetAnnotations":true},"enabled":true,"extraHttpPaths":[],"grpcAnnotations":{"nginx.ingress.kubernetes.io/proxy-body-size":"25m","nginx.ingress.kubernetes.io/ssl-redirect":"true"},"hostname":"","httpAnnotations":{"nginx.ingress.kubernetes.io/ssl-redirect":"true"},"ingressClass":"nginx","pathPrefix":"/diode","tls":{}}` | ref: https://github.com/kubernetes/ingress-nginx/blob/main/charts/ingress-nginx/values.yaml |

charts/diode/templates/diode-auth-bootstrap-job.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ spec:
4646
done;
4747
echo "OAuth2 server is up and running";
4848
{{- end }}
49+
{{- if .Values.diodeAuthBootstrap.job.extraInitContainers }}
50+
{{- include "common.tplvalues.render" ( dict "value" .Values.diodeAuthBootstrap.job.extraInitContainers "context" $ ) | nindent 8 }}
51+
{{- end }}
4952
containers:
5053
- name: {{ include "diode.auth.bootstrapjobname" . }}
5154
image: "{{ .Values.diodeAuthBootstrap.image.repository }}:{{ .Values.diodeAuthBootstrap.image.tag }}"

charts/diode/templates/diode-auth-deployment.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ spec:
5555
done;
5656
echo "OAuth2 server is up and running";
5757
{{- end }}
58+
{{- if .Values.diodeAuth.extraInitContainers }}
59+
{{- include "common.tplvalues.render" ( dict "value" .Values.diodeAuth.extraInitContainers "context" $ ) | nindent 8 }}
60+
{{- end }}
5861
containers:
5962
- name: {{ include "diode.auth.servicename" . }}
6063
image: "{{ .Values.diodeAuth.image.repository }}:{{ .Values.diodeAuth.image.tag }}"

charts/diode/templates/diode-ingester-deployment.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ spec:
5353
done;
5454
echo "Redis server is up and running";
5555
{{- end }}
56+
{{- if .Values.diodeAuth.extraInitContainers }}
57+
{{- include "common.tplvalues.render" ( dict "value" .Values.diodeAuth.extraInitContainers "context" $ ) | nindent 8 }}
58+
{{- end }}
5659
containers:
5760
- name: {{ include "diode.ingester.servicename" . }}
5861
image: "{{ .Values.diodeIngester.image.repository }}:{{ .Values.diodeIngester.image.tag }}"

charts/diode/templates/diode-reconciler-deployment.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ spec:
6767
done;
6868
echo "PostgreSQL server is up and running";
6969
{{- end }}
70+
{{- if .Values.diodeAuth.extraInitContainers }}
71+
{{- include "common.tplvalues.render" ( dict "value" .Values.diodeAuth.extraInitContainers "context" $ ) | nindent 8 }}
72+
{{- end }}
7073
containers:
7174
- name: {{ include "diode.reconciler.servicename" . }}
7275
image: "{{ .Values.diodeReconciler.image.repository }}:{{ .Values.diodeReconciler.image.tag }}"

charts/diode/values.yaml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,10 @@ diodeAuth:
6363
limits:
6464
cpu: 500m
6565
memory: 512Mi
66-
# -- extra environment variables to be set on containers' `env` section
66+
# -- (string or list) extra environment variables to be set on containers' `env` section
6767
extraEnvs: []
68+
# -- (string or list) additional containers to run before auth finishes initializing (may contain templating instructions)
69+
extraInitContainers: ""
6870
# -- annotations to add to the auth deployment
6971
annotations: {}
7072
config:
@@ -99,6 +101,8 @@ diodeAuthBootstrap:
99101
annotations:
100102
"helm.sh/hook": post-install, post-upgrade
101103
"helm.sh/hook-weight": "2"
104+
# -- (string or list) additional initContainers to run during bootstrap (may contain templating instructions)
105+
extraInitContainers: ""
102106

103107
# Diode Ingester configuration
104108
diodeIngester:
@@ -133,8 +137,10 @@ diodeIngester:
133137
grpc:
134138
# -- grpc service name
135139
serviceName: diode.v1.IngesterService
136-
# -- extra environment variables to be set on containers' `env` section
140+
# -- (string or list) extra environment variables to be set on containers' `env` section
137141
extraEnvs: []
142+
# -- (string or list) additional containers to run before the ingester finishes initializing (may contain templating instructions)
143+
extraInitContainers: ""
138144
# -- annotations to add to the ingester deployment
139145
annotations: {}
140146
config:
@@ -184,8 +190,10 @@ diodeReconciler:
184190
grpc:
185191
# -- grpc service name
186192
serviceName: diode.v1.ReconcilerService
187-
# -- extra environment variables to be set on containers' `env` section
193+
# -- (string or list) extra environment variables to be set on containers' `env` section
188194
extraEnvs: []
195+
# -- (string or list) additional containers to run before the reconciler finishes initializing (may contain templating instructions)
196+
extraInitContainers: ""
189197
# -- annotations to add to the reconciler deployment
190198
annotations: {}
191199
config:
@@ -361,7 +369,7 @@ hydra:
361369
# -- dev mode
362370
dev: true # Hydra is not exposed to the public internet
363371
deployment:
364-
# -- extra init containers
372+
# -- (string or list) extra init containers
365373
extraInitContainers: |-
366374
{{ include "diode.hydra.extrainitcontainers" . }}
367375
# -- resources
@@ -378,7 +386,7 @@ hydra:
378386
"helm.sh/hook": post-install, post-upgrade
379387
"helm.sh/hook-weight": "1"
380388
"helm.sh/hook-delete-policy": hook-succeeded
381-
# -- extra init containers
389+
# -- (string or list) extra init containers
382390
extraInitContainers: |-
383391
{{ include "diode.hydra.extrainitcontainers" . }}
384392

0 commit comments

Comments
 (0)