From 1d0bc9484230a8c611959b855c7997ba65745a81 Mon Sep 17 00:00:00 2001 From: Paul Laffitte Date: Thu, 16 Nov 2023 11:57:10 +0100 Subject: [PATCH] feat: allow to add extra envs and preconfigure no_proxy variable --- .../templates/controller-deployment.yaml | 12 ++++++++++++ .../kube-image-keeper/templates/proxy-daemonset.yaml | 4 ++++ helm/kube-image-keeper/values.yaml | 4 ++++ 3 files changed, 20 insertions(+) diff --git a/helm/kube-image-keeper/templates/controller-deployment.yaml b/helm/kube-image-keeper/templates/controller-deployment.yaml index 7ab05dbc..aff9b3d3 100644 --- a/helm/kube-image-keeper/templates/controller-deployment.yaml +++ b/helm/kube-image-keeper/templates/controller-deployment.yaml @@ -58,6 +58,18 @@ spec: - -root-certificate-authorities=/etc/ssl/certs/registry-certificate-authorities/{{- . }} {{- end }} {{- end }} + env: + {{- $noProxy := list -}} + {{- range .Values.controllers.env }} + {{- if eq (lower .name) "no_proxy" }} + {{- $noProxy = (.value | replace " " "," | splitList ",") -}} + {{- else }} + - name: {{ .name }} + value: {{ .value }} + {{- end }} + {{- end }} + - name: no_proxy + value: {{ join "," (prepend $noProxy (printf "%s-registry" (include "kube-image-keeper.fullname" .))) }} ports: - containerPort: 9443 name: webhook-server diff --git a/helm/kube-image-keeper/templates/proxy-daemonset.yaml b/helm/kube-image-keeper/templates/proxy-daemonset.yaml index faf97f8c..ea6f3ada 100644 --- a/helm/kube-image-keeper/templates/proxy-daemonset.yaml +++ b/helm/kube-image-keeper/templates/proxy-daemonset.yaml @@ -58,6 +58,10 @@ spec: {{- end }} {{- end }} {{- if .Values.rootCertificateAuthorities }} + {{- with .Values.proxy.env }} + env: + {{- toYaml . | nindent 12 }} + {{- end }} volumeMounts: - mountPath: /etc/ssl/certs/registry-certificate-authorities name: registry-certificate-authorities diff --git a/helm/kube-image-keeper/values.yaml b/helm/kube-image-keeper/values.yaml index 46da4299..55d89e91 100644 --- a/helm/kube-image-keeper/values.yaml +++ b/helm/kube-image-keeper/values.yaml @@ -52,6 +52,8 @@ controllers: maxUnavailable: "" # -- Affinity for the controller pod affinity: {} + # -- Extra env variables for the controllers pod + env: [] resources: requests: # -- Cpu requests for the controller pod @@ -147,6 +149,8 @@ proxy: priorityClassName: system-node-critical # -- Affinity for the proxy pod affinity: {} + # -- Extra env variables for the proxy pod + env: [] resources: requests: # -- Cpu requests for the proxy pod