From ea3f5c60799947c300153d1cfb06b991ae288bc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathias=20=C3=85hsberg?= Date: Thu, 17 Oct 2024 12:27:17 +0200 Subject: [PATCH] Helm chart: add `extraInitContainers` value (#9773) --- helm/nessie/README.md | 1 + helm/nessie/ci/inmemory-values.yaml | 6 ++++++ helm/nessie/templates/deployment.yaml | 4 ++++ helm/nessie/values.yaml | 7 +++++++ 4 files changed, 18 insertions(+) diff --git a/helm/nessie/README.md b/helm/nessie/README.md index f0fa0367c21..dd5a50b31aa 100644 --- a/helm/nessie/README.md +++ b/helm/nessie/README.md @@ -240,6 +240,7 @@ ct install --charts ./helm/nessie --namespace nessie-ns --debug | dynamodb.secret.awsSecretAccessKey | string | `"aws_secret_access_key"` | The secret key storing the AWS secret access key. | | dynamodb.secret.name | string | `"awscreds"` | The secret name to pull AWS credentials from. Optional; if not present, the default AWS credentials provider chain is used. | | extraEnv | list | `[]` | Advanced configuration via Environment Variables. Extra environment variables to add to the Nessie server container. You can pass here any valid EnvVar object: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.27/#envvar-v1-core This can be useful to get configuration values from Kubernetes secrets or config maps. | +| extraInitContainers | list | `[]` | Add additional init containers to the nessie pod(s) See https://kubernetes.io/docs/concepts/workloads/pods/init-containers/. | | extraServices | list | `[]` | Additional service definitions. All service definitions always select all Nessie pods. Use this if you need to expose specific ports with different configurations. | | extraVolumeMounts | list | `[]` | Extra volume mounts to add to the nessie container. See https://kubernetes.io/docs/concepts/storage/volumes/. | | extraVolumes | list | `[]` | Extra volumes to add to the nessie pod. See https://kubernetes.io/docs/concepts/storage/volumes/. | diff --git a/helm/nessie/ci/inmemory-values.yaml b/helm/nessie/ci/inmemory-values.yaml index 8c77c518045..cfe2497fdf2 100644 --- a/helm/nessie/ci/inmemory-values.yaml +++ b/helm/nessie/ci/inmemory-values.yaml @@ -140,3 +140,9 @@ readinessProbe: periodSeconds: 5 successThreshold: 1 failureThreshold: 3 + +extraInitContainers: + - name: hello-world + image: bash + imagePullPolicy: Always + command: ['sh', '-c', 'echo "hello world"'] diff --git a/helm/nessie/templates/deployment.yaml b/helm/nessie/templates/deployment.yaml index 53947e42ff1..5b253290e3e 100644 --- a/helm/nessie/templates/deployment.yaml +++ b/helm/nessie/templates/deployment.yaml @@ -53,6 +53,10 @@ spec: serviceAccountName: {{ include "nessie.serviceAccountName" . }} securityContext: {{- tpl (toYaml .Values.podSecurityContext) . | nindent 8 }} + {{- if .Values.extraInitContainers }} + initContainers: + {{- tpl (toYaml .Values.extraInitContainers) . | nindent 8 }} + {{- end }} containers: - name: {{ .Chart.Name }} securityContext: diff --git a/helm/nessie/values.yaml b/helm/nessie/values.yaml index c1dcedffb74..d3f426ad1b5 100644 --- a/helm/nessie/values.yaml +++ b/helm/nessie/values.yaml @@ -933,3 +933,10 @@ extraVolumes: [] extraVolumeMounts: [] # - name: extra-volume # mountPath: /usr/share/extra-volume + +# -- Add additional init containers to the nessie pod(s) See https://kubernetes.io/docs/concepts/workloads/pods/init-containers/. +extraInitContainers: [] + # - name: your-image-name + # image: your-image + # imagePullPolicy: Always + # command: ['sh', '-c', 'echo "hello world"']