diff --git a/charts/trino/README.md b/charts/trino/README.md index 79665042..1db8c057 100644 --- a/charts/trino/README.md +++ b/charts/trino/README.md @@ -36,6 +36,7 @@ The following table lists the configurable parameters of the Trino chart and the | `additionalLogProperties` | | `{}` | | `additionalCatalogs` | | `{}` | | `env` | | `[]` | +| `initContainers` | | `{}` | | `securityContext.runAsUser` | | `1000` | | `securityContext.runAsGroup` | | `1000` | | `service.type` | | `"ClusterIP"` | diff --git a/charts/trino/templates/deployment-coordinator.yaml b/charts/trino/templates/deployment-coordinator.yaml index 40415751..9d4750c5 100644 --- a/charts/trino/templates/deployment-coordinator.yaml +++ b/charts/trino/templates/deployment-coordinator.yaml @@ -33,6 +33,10 @@ spec: - name: catalog-volume configMap: name: {{ template "trino.catalog" . }} + {{- if .Values.initContainers.coordinator }} + initContainers: + {{- tpl (toYaml .Values.initContainers.coordinator) . | nindent 6 }} + {{- end }} imagePullSecrets: - name: registry-credentials containers: diff --git a/charts/trino/templates/deployment-worker.yaml b/charts/trino/templates/deployment-worker.yaml index 057afc28..0fbe4235 100644 --- a/charts/trino/templates/deployment-worker.yaml +++ b/charts/trino/templates/deployment-worker.yaml @@ -30,6 +30,10 @@ spec: - name: catalog-volume configMap: name: {{ template "trino.catalog" . }} + {{- if .Values.initContainers.worker }} + initContainers: + {{- tpl (toYaml .Values.initContainers.worker) . | nindent 6 }} + {{- end }} imagePullSecrets: - name: registry-credentials containers: diff --git a/charts/trino/values.yaml b/charts/trino/values.yaml index 190c08cf..a7558c56 100644 --- a/charts/trino/values.yaml +++ b/charts/trino/values.yaml @@ -50,6 +50,17 @@ additionalCatalogs: {} # Array of EnvVar (https://v1-18.docs.kubernetes.io/docs/reference/generated/kubernetes-api/v1.18/#envvar-v1-core) env: [] +initContainers: {} + # coordinator: + # - name: init-coordinator + # image: busybox:1.28 + # imagePullPolicy: IfNotPresent + # command: ['sh', '-c', "until nslookup myservice.$(cat /var/run/secrets/kubernetes.io/serviceaccount/namespace).svc.cluster.local; do echo waiting for myservice; sleep 2; done"] + # worker: + # - name: init-worker + # image: busybox:1.28 + # command: ['sh', '-c', 'echo The worker is running! && sleep 3600'] + securityContext: runAsUser: 1000 runAsGroup: 1000