From bed0cb9338dbbc2fc8dfb2e7e93cdea625804c54 Mon Sep 17 00:00:00 2001 From: Tomer Shefler Date: Tue, 5 Dec 2023 11:44:15 +0200 Subject: [PATCH 1/2] Support setting private images registry and pull secrets for operator deployment in helm install --- .../cbcontainers-operator-chart/templates/deployment.yaml | 4 ++-- .../cbcontainers-operator-chart/templates/operator.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/charts/cbcontainers-operator/cbcontainers-operator-chart/templates/deployment.yaml b/charts/cbcontainers-operator/cbcontainers-operator-chart/templates/deployment.yaml index c4bf017a..b69c802d 100644 --- a/charts/cbcontainers-operator/cbcontainers-operator-chart/templates/deployment.yaml +++ b/charts/cbcontainers-operator/cbcontainers-operator-chart/templates/deployment.yaml @@ -39,7 +39,7 @@ spec: - --logtostderr=true - --http2-disable - --v=0 - image: "{{ .Values.rbacProxy.image.repository }}:{{.Values.rbacProxy.image.version }}" + image: "{{ .Values.imagesRegistry | default "" }}{{ .Values.rbacProxy.image.repository }}:{{.Values.rbacProxy.image.version }}" name: kube-rbac-proxy ports: - containerPort: 8443 @@ -61,7 +61,7 @@ spec: - --leader-elect command: - /manager - image: "{{ .Values.operator.image.repository | default "cbartifactory/octarine-operator" }}:{{ .Values.operator.image.version | default .Chart.AppVersion }}" + image: "{{ .Values.imagesRegistry | default "" }}{{ .Values.operator.image.repository | default "cbartifactory/octarine-operator" }}:{{ .Values.operator.image.version | default .Chart.AppVersion }}" env: - name: OPERATOR_NAMESPACE valueFrom: diff --git a/charts/cbcontainers-operator/cbcontainers-operator-chart/templates/operator.yaml b/charts/cbcontainers-operator/cbcontainers-operator-chart/templates/operator.yaml index 2fa01532..4ae158c4 100644 --- a/charts/cbcontainers-operator/cbcontainers-operator-chart/templates/operator.yaml +++ b/charts/cbcontainers-operator/cbcontainers-operator-chart/templates/operator.yaml @@ -6432,7 +6432,7 @@ spec: --- apiVersion: v1 imagePullSecrets: -- name: cbcontainers-operator-public-registry-secret +- name: {{ default "cbcontainers-operator-public-registry-secret" .Values.imagesPullSecret }} kind: ServiceAccount metadata: name: cbcontainers-operator From 8794980eb03cb0a90e2f98f0bb4701fb8f0e2c5c Mon Sep 17 00:00:00 2001 From: Tomer Shefler Date: Tue, 5 Dec 2023 14:23:57 +0200 Subject: [PATCH 2/2] Remove requirement to fill all proxy field when setting proxy to operator helm --- .../cbcontainers-operator-chart/templates/deployment.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/charts/cbcontainers-operator/cbcontainers-operator-chart/templates/deployment.yaml b/charts/cbcontainers-operator/cbcontainers-operator-chart/templates/deployment.yaml index b69c802d..5220c5a3 100644 --- a/charts/cbcontainers-operator/cbcontainers-operator-chart/templates/deployment.yaml +++ b/charts/cbcontainers-operator/cbcontainers-operator-chart/templates/deployment.yaml @@ -70,11 +70,11 @@ spec: {{/* If you want to enable HTTP Proxy you need to set all 3 of the values - operator.proxy.http, operator.proxy.https and operator.proxy.noProxy */}} {{- if .Values.operator.proxy -}} - name: HTTP_PROXY - value: {{ required "all values under spec.operator.proxy are required if even one is set" .Values.operator.proxy.http }} + value: {{ .Values.operator.proxy.http }} - name: HTTPS_PROXY - value: {{ required "all values under spec.operator.proxy are required if even one is set" .Values.operator.proxy.https }} + value: {{ .Values.operator.proxy.https }} - name: NO_PROXY - value: {{ required "all values under spec.operator.proxy are required if even one is set" .Values.operator.proxy.noProxy }} + value: {{ .Values.operator.proxy.noProxy }} {{- end -}} {{- if .Values.operator.environment -}} {{- with .Values.operator.environment -}}