From f4c451aad9260f9a014ae258a24f29faa7e6c3f6 Mon Sep 17 00:00:00 2001 From: Luca Cominoli Date: Tue, 10 Dec 2024 10:06:24 +0100 Subject: [PATCH] Add initcontainers to tenant Helm Chart --- helm/tenant/templates/tenant.yaml | 3 +++ helm/tenant/values.yaml | 24 ++++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/helm/tenant/templates/tenant.yaml b/helm/tenant/templates/tenant.yaml index 24a1b4ef620..173e44f4ff6 100644 --- a/helm/tenant/templates/tenant.yaml +++ b/helm/tenant/templates/tenant.yaml @@ -25,6 +25,9 @@ spec: imagePullSecret: name: {{ dig "imagePullSecret" "name" "" . }} {{- end }} + {{- with (dig "initContainers" (list) .) }} + initContainers: {{- toYaml . | nindent 4 }} + {{- end }} ## Secret with default environment variable configurations configuration: name: {{ .configuration.name }} diff --git a/helm/tenant/values.yaml b/helm/tenant/values.yaml index 52d8ca8dd62..1dcc4311502 100644 --- a/helm/tenant/values.yaml +++ b/helm/tenant/values.yaml @@ -38,6 +38,30 @@ tenant: # Only one array element is supported at this time. imagePullSecret: { } ### + # + # Specify `initContainers `__ to perform setup or configuration tasks before the main Tenant pods starts. + # + # Example of init container which waits for idenity provider to be reachable before starting MinIO Tenant: + # + # .. code-block:: yaml + # + # initContainers: + # - name: wait-for-idp + # image: busybox + # command: + # - sh + # - -c + # - | + # URL="https://idp-url" + # echo "Checking IdP reachability (${URL})" + # until $(wget -q -O "/dev/null" ${URL}) ; do + # echo "IdP (${URL}) not reachable. Waiting to be reachable..." + # sleep 5 + # done + # echo "IdP (${URL}) reachable. Starting MinIO..." + # + initContainers: [ ] + ### # The Kubernetes `Scheduler `__ to use for dispatching Tenant pods. # # Specify an empty dictionary ``{}`` to dispatch pods with the default scheduler.