From e19ff7c2f6b7e4700d07c12a0d86367a3a4eaf11 Mon Sep 17 00:00:00 2001 From: radek Date: Fri, 6 Oct 2023 11:59:01 +0200 Subject: [PATCH] Add support for sidecar containers --- charts/trino/README.md | 3 +++ .../trino/templates/deployment-coordinator.yaml | 6 ++++++ charts/trino/templates/deployment-worker.yaml | 6 ++++++ charts/trino/values.yaml | 16 ++++++++++++++++ 4 files changed, 31 insertions(+) diff --git a/charts/trino/README.md b/charts/trino/README.md index 57654c98..18c89fe8 100644 --- a/charts/trino/README.md +++ b/charts/trino/README.md @@ -44,8 +44,11 @@ The following table lists the configurable parameters of the Trino chart and the | `env` | | `[]` | | `envFrom` | | `[]` | | `initContainers` | | `{}` | +| `sidecarContainers` | | `{}` | | `securityContext.runAsUser` | | `1000` | | `securityContext.runAsGroup` | | `1000` | +| `shareProcessNamespace.coordinator` | | `false` | +| `shareProcessNamespace.worker` | | `false` | | `service.type` | | `"ClusterIP"` | | `service.port` | | `8080` | | `auth` | | `{}` | diff --git a/charts/trino/templates/deployment-coordinator.yaml b/charts/trino/templates/deployment-coordinator.yaml index 3edaaf5a..0941f9c5 100644 --- a/charts/trino/templates/deployment-coordinator.yaml +++ b/charts/trino/templates/deployment-coordinator.yaml @@ -40,6 +40,9 @@ spec: runAsUser: {{ .runAsUser }} runAsGroup: {{ .runAsGroup }} {{- end }} + {{- if .Values.shareProcessNamespace.coordinator }} + shareProcessNamespace: {{ .Values.shareProcessNamespace.coordinator }} + {{- end }} volumes: - name: config-volume configMap: @@ -143,6 +146,9 @@ spec: successThreshold: {{ .Values.coordinator.readinessProbe.successThreshold | default 1 }} resources: {{- toYaml .Values.coordinator.resources | nindent 12 }} + {{- if .Values.sidecarContainers.coordinator }} + {{- toYaml .Values.sidecarContainers.coordinator | nindent 8 }} + {{- end }} {{- with .Values.coordinator.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} diff --git a/charts/trino/templates/deployment-worker.yaml b/charts/trino/templates/deployment-worker.yaml index 3404b9c1..99a3281f 100644 --- a/charts/trino/templates/deployment-worker.yaml +++ b/charts/trino/templates/deployment-worker.yaml @@ -44,6 +44,9 @@ spec: runAsUser: {{ .runAsUser }} runAsGroup: {{ .runAsGroup }} {{- end }} + {{- if .Values.shareProcessNamespace.worker }} + shareProcessNamespace: {{ .Values.shareProcessNamespace.worker }} + {{- end }} volumes: - name: config-volume configMap: @@ -122,6 +125,9 @@ spec: successThreshold: {{ .Values.worker.readinessProbe.successThreshold | default 1 }} resources: {{- toYaml .Values.worker.resources | nindent 12 }} + {{- if .Values.sidecarContainers.worker }} + {{- toYaml .Values.sidecarContainers.worker | nindent 8 }} + {{- end }} {{- with .Values.worker.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} diff --git a/charts/trino/values.yaml b/charts/trino/values.yaml index 267e54b4..3e496207 100644 --- a/charts/trino/values.yaml +++ b/charts/trino/values.yaml @@ -125,10 +125,26 @@ initContainers: {} # image: busybox:1.28 # command: ['sh', '-c', 'echo The worker is running! && sleep 3600'] +sidecarContainers: {} +# coordinator: +# - name: side-coordinator +# image: busybox:1.28 +# imagePullPolicy: IfNotPresent +# command: ['sleep', '1'] +# worker: +# - name: side-worker +# image: busybox:1.28 +# imagePullPolicy: IfNotPresent +# command: ['sleep', '1'] + securityContext: runAsUser: 1000 runAsGroup: 1000 +shareProcessNamespace: + coordinator: false + worker: false + service: type: ClusterIP port: 8080