From 9be3e6bf9d3a83b98efbedf09da0f93650e6ddea Mon Sep 17 00:00:00 2001 From: "ivan.kosianenko" Date: Wed, 1 Jun 2022 11:03:43 +0300 Subject: [PATCH 1/3] Add ability to specify global image registry in values --- charts/dremio_v2/docs/Values-Reference.md | 8 ++++---- charts/dremio_v2/templates/dremio-admin.yaml | 2 +- charts/dremio_v2/templates/dremio-coordinator.yaml | 8 ++++---- charts/dremio_v2/templates/dremio-executor.yaml | 4 ++-- charts/dremio_v2/templates/dremio-master.yaml | 12 ++++++------ charts/dremio_v2/values.yaml | 14 ++++++++++---- 6 files changed, 27 insertions(+), 21 deletions(-) diff --git a/charts/dremio_v2/docs/Values-Reference.md b/charts/dremio_v2/docs/Values-Reference.md index ee5553e1..f3bfb1a0 100644 --- a/charts/dremio_v2/docs/Values-Reference.md +++ b/charts/dremio_v2/docs/Values-Reference.md @@ -230,7 +230,7 @@ For example, to have an `initContainer` with the Dremio image, you can specify t ```yaml extraInitContainers: | - name: dremio-hello-world - image: {{ $.Values.image }}:{{ $.Values.imageTag }} + image: {{ $.Values.global.imageRegistry }}{{ $.Values.image }}:{{ $.Values.imageTag }} command: ["echo", "Hello World"] [...] ``` @@ -565,7 +565,7 @@ coordinator: [...] extraInitContainers: | - name: dremio-hello-world - image: {{ $.Values.image }}:{{ $.Values.imageTag }} + image: {{ $.Values.global.imageRegistry }}{{ $.Values.image }}:{{ $.Values.imageTag }} command: ["echo", "Hello World"] [...] ``` @@ -842,7 +842,7 @@ coordinator: [...] extraInitContainers: | - name: dremio-hello-world - image: {{ $.Values.image }}:{{ $.Values.imageTag }} + image: {{ $.Values.global.imageRegistry }}{{ $.Values.image }}:{{ $.Values.imageTag }} command: ["echo", "Hello World"] [...] ``` @@ -940,7 +940,7 @@ executor: extraInitContainers: | - name: dremio-hello-world - image: {{ $.Values.image }}:{{ $.Values.imageTag }} + image: {{ $.Values.global.imageRegistry }}{{ $.Values.image }}:{{ $.Values.imageTag }} command: ["echo", "Hello World"] extraVolumes: diff --git a/charts/dremio_v2/templates/dremio-admin.yaml b/charts/dremio_v2/templates/dremio-admin.yaml index 10de4317..089359d0 100644 --- a/charts/dremio_v2/templates/dremio-admin.yaml +++ b/charts/dremio_v2/templates/dremio-admin.yaml @@ -14,7 +14,7 @@ metadata: spec: containers: - name: dremio-admin - image: {{ $.Values.image }}:{{ $.Values.imageTag }} + image: {{ $.Values.global.imageRegistry }}{{ $.Values.image }}:{{ $.Values.imageTag }} imagePullPolicy: IfNotPresent stdin: true tty: true diff --git a/charts/dremio_v2/templates/dremio-coordinator.yaml b/charts/dremio_v2/templates/dremio-coordinator.yaml index dc5d8426..4d104a48 100644 --- a/charts/dremio_v2/templates/dremio-coordinator.yaml +++ b/charts/dremio_v2/templates/dremio-coordinator.yaml @@ -29,7 +29,7 @@ spec: {{- include "dremio.coordinator.tolerations" $ | nindent 6 }} containers: - name: dremio-coordinator - image: {{ $.Values.image }}:{{ $.Values.imageTag }} + image: {{ $.Values.global.imageRegistry }}{{ $.Values.image }}:{{ $.Values.imageTag }} imagePullPolicy: IfNotPresent resources: requests: @@ -96,7 +96,7 @@ spec: command: ["sh", "-c", "until nc -z dremio-client {{ $.Values.coordinator.web.port }} > /dev/null; do echo Waiting for Dremio master.; sleep 2; done;"] {{- if $.Values.coordinator.web.tls.enabled }} - name: generate-ui-keystore - image: {{ $.Values.image }}:{{ $.Values.imageTag }} + image: {{ $.Values.global.imageRegistry }}{{ $.Values.image }}:{{ $.Values.imageTag }} imagePullPolicy: IfNotPresent volumeMounts: - name: dremio-tls @@ -108,7 +108,7 @@ spec: {{- end }} {{- if $.Values.coordinator.client.tls.enabled }} - name: generate-client-keystore - image: {{ $.Values.image }}:{{ $.Values.imageTag }} + image: {{ $.Values.global.imageRegistry }}{{ $.Values.image }}:{{ $.Values.imageTag }} imagePullPolicy: IfNotPresent volumeMounts: - name: dremio-tls @@ -120,7 +120,7 @@ spec: {{- end }} {{- if $.Values.coordinator.flight.tls.enabled }} - name: generate-flight-keystore - image: {{ $.Values.image }}:{{ $.Values.imageTag }} + image: {{ $.Values.global.imageRegistry }}{{ $.Values.image }}:{{ $.Values.imageTag }} imagePullPolicy: IfNotPresent volumeMounts: - name: dremio-tls diff --git a/charts/dremio_v2/templates/dremio-executor.yaml b/charts/dremio_v2/templates/dremio-executor.yaml index fffdc53c..cb5ff788 100644 --- a/charts/dremio_v2/templates/dremio-executor.yaml +++ b/charts/dremio_v2/templates/dremio-executor.yaml @@ -32,7 +32,7 @@ spec: {{- include "dremio.executor.tolerations" (list $ $engineName) | nindent 6}} containers: - name: dremio-executor - image: {{ $.Values.image }}:{{ $.Values.imageTag }} + image: {{ $.Values.global.imageRegistry }}{{ $.Values.image }}:{{ $.Values.imageTag }} imagePullPolicy: IfNotPresent resources: requests: @@ -82,7 +82,7 @@ spec: initContainers: {{- include "dremio.executor.extraInitContainers" (list $ $engineName) | nindent 6 }} - name: chown-data-directory - image: {{ $.Values.image }}:{{ $.Values.imageTag }} + image: {{ $.Values.global.imageRegistry }}{{ $.Values.image }}:{{ $.Values.imageTag }} imagePullPolicy: IfNotPresent securityContext: runAsUser: 0 diff --git a/charts/dremio_v2/templates/dremio-master.yaml b/charts/dremio_v2/templates/dremio-master.yaml index f2f9b792..ca005547 100644 --- a/charts/dremio_v2/templates/dremio-master.yaml +++ b/charts/dremio_v2/templates/dremio-master.yaml @@ -38,7 +38,7 @@ spec: {{- include "dremio.coordinator.tolerations" $ | nindent 6 }} containers: - name: dremio-master-coordinator - image: {{ $.Values.image }}:{{ $.Values.imageTag }} + image: {{ $.Values.global.imageRegistry }}{{ $.Values.image }}:{{ $.Values.imageTag }} imagePullPolicy: IfNotPresent resources: requests: @@ -112,7 +112,7 @@ spec: image: busybox command: ["sh", "-c", "until ping -c 1 -W 1 zk-hs > /dev/null; do echo Waiting for Zookeeper to be ready.; sleep 2; done;"] - name: chown-data-directory - image: {{ $.Values.image }}:{{ $.Values.imageTag }} + image: {{ $.Values.global.imageRegistry }}{{ $.Values.image }}:{{ $.Values.imageTag }} imagePullPolicy: IfNotPresent securityContext: runAsUser: 0 @@ -124,7 +124,7 @@ spec: - "dremio:dremio" - "/opt/dremio/data" - name: upgrade-task - image: {{ $.Values.image }}:{{ $.Values.imageTag }} + image: {{ $.Values.global.imageRegistry }}{{ $.Values.image }}:{{ $.Values.imageTag }} imagePullPolicy: IfNotPresent volumeMounts: - name: dremio-master-volume @@ -136,7 +136,7 @@ spec: - "upgrade" {{- if $.Values.coordinator.web.tls.enabled }} - name: generate-ui-keystore - image: {{ $.Values.image }}:{{ $.Values.imageTag }} + image: {{ $.Values.global.imageRegistry }}{{ $.Values.image }}:{{ $.Values.imageTag }} imagePullPolicy: IfNotPresent volumeMounts: - name: dremio-tls @@ -148,7 +148,7 @@ spec: {{- end }} {{- if $.Values.coordinator.client.tls.enabled }} - name: generate-client-keystore - image: {{ $.Values.image }}:{{ $.Values.imageTag }} + image: {{ $.Values.global.imageRegistry }}{{ $.Values.image }}:{{ $.Values.imageTag }} imagePullPolicy: IfNotPresent volumeMounts: - name: dremio-tls @@ -160,7 +160,7 @@ spec: {{- end }} {{- if $.Values.coordinator.flight.tls.enabled }} - name: generate-flight-keystore - image: {{ $.Values.image }}:{{ $.Values.imageTag }} + image: {{ $.Values.global.imageRegistry }}{{ $.Values.image }}:{{ $.Values.imageTag }} imagePullPolicy: IfNotPresent volumeMounts: - name: dremio-tls diff --git a/charts/dremio_v2/values.yaml b/charts/dremio_v2/values.yaml index cdb9e646..4be88964 100644 --- a/charts/dremio_v2/values.yaml +++ b/charts/dremio_v2/values.yaml @@ -16,6 +16,12 @@ image: dremio/dremio-oss imageTag: latest +# Global image registry +# make sure to add slash in the end of URL +# Example: your_private_global_registry:8080/ +global: + imageRegistry: "" + # Annotations, labels, node selectors, and tolerations # # annotations: Annotations are applied to the StatefulSets that are deployed. @@ -62,7 +68,7 @@ coordinator: # Uncomment the below lines to use a custom set of extra init containers for the coordinator. #extraInitContainers: | # - name: extra-init-container - # image: {{ $.Values.image }}:{{ $.Values.imageTag }} + # image: {{ $.Values.global.imageRegistry }}{{ $.Values.image }}:{{ $.Values.imageTag }} # command: ["echo", "Hello World"] # Extra Volumes @@ -152,7 +158,7 @@ executor: # Uncomment the below lines to use a custom set of extra init containers for executors. #extraInitContainers: | # - name: extra-init-container - # image: {{ $.Values.image }}:{{ $.Values.imageTag }} + # image: {{ $.Values.global.imageRegistry }}{{ $.Values.image }}:{{ $.Values.imageTag }} # command: ["echo", "Hello World"] # Extra Volumes @@ -230,7 +236,7 @@ executor: # # extraInitContainers: | # - name: extra-init-container - # image: {{ $.Values.image }}:{{ $.Values.imageTag }} + # image: {{ $.Values.global.imageRegistry }}{{ $.Values.image }}:{{ $.Values.imageTag }} # command: ["echo", "Hello World"] # # @@ -425,7 +431,7 @@ distStorage: # Uncomment the below lines to provide extra init containers to be run first. #extraInitContainers: | # - name: extra-init-container -# image: {{ $.Values.image }}:{{ $.Values.imageTag }} +# image: {{ $.Values.global.imageRegistry }}{{ $.Values.image }}:{{ $.Values.imageTag }} # command: ["echo", "Hello World"] # Kubernetes Service Account From 2ac1425df611e463ce8aff3d15c2746ee05afe64 Mon Sep 17 00:00:00 2001 From: "ivan.kosianenko" Date: Wed, 1 Jun 2022 13:41:56 +0300 Subject: [PATCH 2/3] Update chart v1 --- charts/dremio/templates/dremio-admin.yaml | 2 +- charts/dremio/templates/dremio-coordinator.yaml | 8 ++++---- charts/dremio/templates/dremio-executor.yaml | 6 +++--- charts/dremio/templates/dremio-master.yaml | 14 +++++++------- charts/dremio/values.yaml | 6 ++++++ charts/dremio_v2/templates/_helpers_executor.tpl | 2 +- charts/dremio_v2/templates/dremio-coordinator.yaml | 2 +- charts/dremio_v2/templates/dremio-executor.yaml | 2 +- charts/dremio_v2/templates/dremio-master.yaml | 4 ++-- charts/dremio_v2/templates/zookeeper.yaml | 2 +- 10 files changed, 27 insertions(+), 21 deletions(-) diff --git a/charts/dremio/templates/dremio-admin.yaml b/charts/dremio/templates/dremio-admin.yaml index feda9d9b..26adcdd0 100644 --- a/charts/dremio/templates/dremio-admin.yaml +++ b/charts/dremio/templates/dremio-admin.yaml @@ -12,7 +12,7 @@ metadata: spec: containers: - name: dremio-admin - image: {{.Values.image}}:{{.Values.imageTag}} + image: {{.Values.global.imageRegistry}}{{.Values.image}}:{{.Values.imageTag}} imagePullPolicy: IfNotPresent stdin: true tty: true diff --git a/charts/dremio/templates/dremio-coordinator.yaml b/charts/dremio/templates/dremio-coordinator.yaml index 3089c1ad..64cf65e8 100644 --- a/charts/dremio/templates/dremio-coordinator.yaml +++ b/charts/dremio/templates/dremio-coordinator.yaml @@ -28,7 +28,7 @@ spec: {{- end }} containers: - name: dremio-coordinator - image: {{.Values.image}}:{{.Values.imageTag}} + image: {{.Values.global.imageRegistry}}{{.Values.image}}:{{.Values.imageTag}} imagePullPolicy: IfNotPresent resources: requests: @@ -66,11 +66,11 @@ spec: name: server initContainers: - name: wait-for-zk - image: busybox + image: {{.Values.global.imageRegistry}}busybox command: ["sh", "-c", "until nc -z dremio-client {{ .Values.coordinator.web.port | default 9047 }} > /dev/null; do echo waiting for dremio master; sleep 2; done;"] {{- if .Values.tls.ui.enabled }} - name: generate-ui-keystore - image: {{.Values.image}}:{{.Values.imageTag}} + image: {{.Values.global.imageRegistry}}{{.Values.image}}:{{.Values.imageTag}} imagePullPolicy: IfNotPresent volumeMounts: - name: dremio-tls @@ -92,7 +92,7 @@ spec: {{- end }} {{- if .Values.tls.client.enabled }} - name: generate-client-keystore - image: {{.Values.image}}:{{.Values.imageTag}} + image: {{.Values.global.imageRegistry}}{{.Values.image}}:{{.Values.imageTag}} imagePullPolicy: IfNotPresent volumeMounts: - name: dremio-tls diff --git a/charts/dremio/templates/dremio-executor.yaml b/charts/dremio/templates/dremio-executor.yaml index 150e1fe1..4f7873c8 100644 --- a/charts/dremio/templates/dremio-executor.yaml +++ b/charts/dremio/templates/dremio-executor.yaml @@ -28,7 +28,7 @@ spec: {{- end }} containers: - name: dremio-executor - image: {{.Values.image}}:{{.Values.imageTag}} + image: {{.Values.global.imageRegistry}}{{.Values.image}}:{{.Values.imageTag}} imagePullPolicy: IfNotPresent resources: requests: @@ -59,12 +59,12 @@ spec: name: server initContainers: - name: wait-for-zk - image: busybox + image: {{.Values.global.imageRegistry}}busybox command: ["sh", "-c", "until ping -c 1 -W 1 zk-hs > /dev/null; do echo waiting for zookeeper host; sleep 2; done;"] # since we're mounting a separate volume, reset permission to # dremio uid/gid - name: chown-data-directory - image: {{.Values.image}}:{{.Values.imageTag}} + image: {{.Values.global.imageRegistry}}{{.Values.image}}:{{.Values.imageTag}} imagePullPolicy: IfNotPresent securityContext: runAsUser: 0 diff --git a/charts/dremio/templates/dremio-master.yaml b/charts/dremio/templates/dremio-master.yaml index 51619193..8d97f894 100644 --- a/charts/dremio/templates/dremio-master.yaml +++ b/charts/dremio/templates/dremio-master.yaml @@ -36,7 +36,7 @@ spec: {{- end }} containers: - name: dremio-master-coordinator - image: {{.Values.image}}:{{.Values.imageTag}} + image: {{.Values.global.imageRegistry}}{{.Values.image}}:{{.Values.imageTag}} imagePullPolicy: IfNotPresent resources: requests: @@ -85,14 +85,14 @@ spec: periodSeconds: 5 initContainers: - name: start-only-one-master - image: busybox + image: {{.Values.global.imageRegistry}}busybox command: ["sh", "-c", "INDEX=${HOSTNAME##*-}; if [ $INDEX -ne 0 ]; then echo Only one master should be running.; exit 1; fi; "] - name: wait-for-zk - image: busybox + image: {{.Values.global.imageRegistry}}busybox command: ["sh", "-c", "until ping -c 1 -W 1 zk-hs > /dev/null; do echo waiting for zookeeper host; sleep 2; done;"] # since we're mounting a separate volume, reset permission to dremio uid/gid - name: chown-data-directory - image: {{.Values.image}}:{{.Values.imageTag}} + image: {{.Values.global.imageRegistry}}{{.Values.image}}:{{.Values.imageTag}} imagePullPolicy: IfNotPresent securityContext: runAsUser: 0 @@ -104,7 +104,7 @@ spec: - "dremio:dremio" - "/opt/dremio/data" - name: upgrade-task - image: {{.Values.image}}:{{.Values.imageTag}} + image: {{.Values.global.imageRegistry}}{{.Values.image}}:{{.Values.imageTag}} imagePullPolicy: IfNotPresent volumeMounts: - name: dremio-master-volume @@ -114,7 +114,7 @@ spec: - "upgrade" {{- if .Values.tls.ui.enabled }} - name: generate-ui-keystore - image: {{.Values.image}}:{{.Values.imageTag}} + image: {{.Values.global.imageRegistry}}{{.Values.image}}:{{.Values.imageTag}} imagePullPolicy: IfNotPresent volumeMounts: - name: dremio-tls @@ -136,7 +136,7 @@ spec: {{- end }} {{- if .Values.tls.client.enabled }} - name: generate-client-keystore - image: {{.Values.image}}:{{.Values.imageTag}} + image: {{.Values.global.imageRegistry}}{{.Values.image}}:{{.Values.imageTag}} imagePullPolicy: IfNotPresent volumeMounts: - name: dremio-tls diff --git a/charts/dremio/values.yaml b/charts/dremio/values.yaml index 925b88a3..6dfeb21d 100644 --- a/charts/dremio/values.yaml +++ b/charts/dremio/values.yaml @@ -4,6 +4,12 @@ image: dremio/dremio-oss imageTag: latest +# Global image registry +# make sure to add slash in the end of URL +# Example: your_private_global_registry:8080/ +global: + imageRegistry: "" + # Check out Dremio documentation for memory and cpu requirements for # the coordinators and the executors. # The value of memory should be in MB. CPU is in no of cores. diff --git a/charts/dremio_v2/templates/_helpers_executor.tpl b/charts/dremio_v2/templates/_helpers_executor.tpl index d8ae6d21..19872c81 100644 --- a/charts/dremio_v2/templates/_helpers_executor.tpl +++ b/charts/dremio_v2/templates/_helpers_executor.tpl @@ -216,7 +216,7 @@ Executor - Cloud Cache Peristent Volume Mounts {{- $cloudCacheConfig := coalesce $engineConfiguration.cloudCache $context.Values.executor.cloudCache -}} {{- if $cloudCacheConfig.enabled -}} - name: chown-cloudcache-directory - image: {{ $context.Values.image }}:{{ $context.Values.imageTag }} + image: {{ $context.Values.global.imageRegistry }}{{ $context.Values.image }}:{{ $context.Values.imageTag }} imagePullPolicy: IfNotPresent securityContext: runAsUser: 0 diff --git a/charts/dremio_v2/templates/dremio-coordinator.yaml b/charts/dremio_v2/templates/dremio-coordinator.yaml index 4d104a48..ad08cb22 100644 --- a/charts/dremio_v2/templates/dremio-coordinator.yaml +++ b/charts/dremio_v2/templates/dremio-coordinator.yaml @@ -92,7 +92,7 @@ spec: initContainers: {{- include "dremio.coordinator.extraInitContainers" $ | nindent 6 }} - name: wait-for-dremio-master - image: busybox + image: {{ $.Values.global.imageRegistry }}busybox command: ["sh", "-c", "until nc -z dremio-client {{ $.Values.coordinator.web.port }} > /dev/null; do echo Waiting for Dremio master.; sleep 2; done;"] {{- if $.Values.coordinator.web.tls.enabled }} - name: generate-ui-keystore diff --git a/charts/dremio_v2/templates/dremio-executor.yaml b/charts/dremio_v2/templates/dremio-executor.yaml index cb5ff788..ba1d3925 100644 --- a/charts/dremio_v2/templates/dremio-executor.yaml +++ b/charts/dremio_v2/templates/dremio-executor.yaml @@ -93,7 +93,7 @@ spec: args: ["dremio:dremio", "/opt/dremio/data"] {{- include "dremio.executor.cloudCache.initContainers" (list $ $engineName) | nindent 6 }} - name: wait-for-zookeeper - image: busybox + image: {{ $.Values.global.imageRegistry }}busybox command: ["sh", "-c", "until ping -c 1 -W 1 zk-hs > /dev/null; do echo Waiting for Zookeeper to be ready.; sleep 2; done;"] volumes: - name: dremio-config diff --git a/charts/dremio_v2/templates/dremio-master.yaml b/charts/dremio_v2/templates/dremio-master.yaml index ca005547..90b48aae 100644 --- a/charts/dremio_v2/templates/dremio-master.yaml +++ b/charts/dremio_v2/templates/dremio-master.yaml @@ -106,10 +106,10 @@ spec: initContainers: {{- include "dremio.coordinator.extraInitContainers" $ | nindent 6 }} - name: start-only-one-dremio-master - image: busybox + image: {{ $.Values.global.imageRegistry }}busybox command: ["sh", "-c", "INDEX=${HOSTNAME##*-}; if [ $INDEX -ne 0 ]; then echo Only one master should be running.; exit 1; fi; "] - name: wait-for-zookeeper - image: busybox + image: {{ $.Values.global.imageRegistry }}busybox command: ["sh", "-c", "until ping -c 1 -W 1 zk-hs > /dev/null; do echo Waiting for Zookeeper to be ready.; sleep 2; done;"] - name: chown-data-directory image: {{ $.Values.global.imageRegistry }}{{ $.Values.image }}:{{ $.Values.imageTag }} diff --git a/charts/dremio_v2/templates/zookeeper.yaml b/charts/dremio_v2/templates/zookeeper.yaml index c5494513..ef619a65 100644 --- a/charts/dremio_v2/templates/zookeeper.yaml +++ b/charts/dremio_v2/templates/zookeeper.yaml @@ -78,7 +78,7 @@ spec: containers: - name: kubernetes-zookeeper imagePullPolicy: Always - image: "{{ $.Values.zookeeper.image }}:{{ $.Values.zookeeper.imageTag }}" + image: "{{ $.Values.global.imageRegistry }}{{ $.Values.zookeeper.image }}:{{ $.Values.zookeeper.imageTag }}" resources: requests: cpu: {{ $.Values.zookeeper.cpu }} From d7623abc2dcbcae2f067a1cae2efc872121ff193 Mon Sep 17 00:00:00 2001 From: "ivan.kosianenko" Date: Wed, 1 Jun 2022 14:59:05 +0300 Subject: [PATCH 3/3] Fixing zookeeper image --- charts/dremio_v2/templates/zookeeper.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/dremio_v2/templates/zookeeper.yaml b/charts/dremio_v2/templates/zookeeper.yaml index ef619a65..c5494513 100644 --- a/charts/dremio_v2/templates/zookeeper.yaml +++ b/charts/dremio_v2/templates/zookeeper.yaml @@ -78,7 +78,7 @@ spec: containers: - name: kubernetes-zookeeper imagePullPolicy: Always - image: "{{ $.Values.global.imageRegistry }}{{ $.Values.zookeeper.image }}:{{ $.Values.zookeeper.imageTag }}" + image: "{{ $.Values.zookeeper.image }}:{{ $.Values.zookeeper.imageTag }}" resources: requests: cpu: {{ $.Values.zookeeper.cpu }}