From 284394fd99a4a24202642704bea7014661a06c3b Mon Sep 17 00:00:00 2001 From: Marco Geri Date: Mon, 19 Dec 2022 07:00:10 +0100 Subject: [PATCH] support extra env in manager DaemonSet (#25) Now is possible to add extra environment variables in the manager DaemonSet. This allows for example to support corporate proxy when downloading images with ImagePullJob setting the HTTP_PROXY, HTTPS_PROXY, NO_PROXY env vars. Signed-off-by: Marco Geri Signed-off-by: Marco Geri --- versions/kruise/1.3.0/Chart.yaml | 1 + versions/kruise/1.3.0/README.md | 1 + versions/kruise/1.3.0/templates/manager.yaml | 3 +++ versions/kruise/1.3.0/values.yaml | 12 ++++++++++++ 4 files changed, 17 insertions(+) diff --git a/versions/kruise/1.3.0/Chart.yaml b/versions/kruise/1.3.0/Chart.yaml index 0ef428e..ec23607 100644 --- a/versions/kruise/1.3.0/Chart.yaml +++ b/versions/kruise/1.3.0/Chart.yaml @@ -21,3 +21,4 @@ sources: annotations: artifacthub.io/changes: | - "[Changed]: https://github.com/openkruise/kruise/blob/master/CHANGELOG.md" + - "[Changed]: Support extra environment variables in the manager DaemonSet" \ No newline at end of file diff --git a/versions/kruise/1.3.0/README.md b/versions/kruise/1.3.0/README.md index 390352c..b1b8762 100644 --- a/versions/kruise/1.3.0/README.md +++ b/versions/kruise/1.3.0/README.md @@ -23,6 +23,7 @@ The following table lists the configurable parameters of the kruise chart and th | `manager.nodeAffinity` | Node affinity policy for kruise-manager pod | `{}` | | `manager.nodeSelector` | Node labels for kruise-manager pod | `{}` | | `manager.tolerations` | Tolerations for kruise-manager pod | `[]` | +| `daemon.extraEnvs` | Extra environment variables that will be pass onto pods | `[]` | | `daemon.log.level` | Log level that kruise-daemon printed | `4` | | `daemon.port` | Port of metrics and healthz that kruise-daemon served | `10221` | | `daemon.pprofAddr` | Address of pprof served | `localhost:10222` | diff --git a/versions/kruise/1.3.0/templates/manager.yaml b/versions/kruise/1.3.0/templates/manager.yaml index 53f778b..0583464 100644 --- a/versions/kruise/1.3.0/templates/manager.yaml +++ b/versions/kruise/1.3.0/templates/manager.yaml @@ -197,6 +197,9 @@ spec: fieldRef: apiVersion: v1 fieldPath: spec.nodeName + {{- if .Values.daemon.extraEnvs }} + {{- toYaml .Values.daemon.extraEnvs | nindent 8 }} + {{- end }} livenessProbe: failureThreshold: 3 httpGet: diff --git a/versions/kruise/1.3.0/values.yaml b/versions/kruise/1.3.0/values.yaml index dc517b4..aca1bf9 100644 --- a/versions/kruise/1.3.0/values.yaml +++ b/versions/kruise/1.3.0/values.yaml @@ -72,5 +72,17 @@ daemon: cpu: "0" memory: "0" + # Extra environment variables that will be pass onto pods. + # For example, when the daemon is used behind a http proxy, you can set the proxy environment variables here. + # This will be appended to the current 'env:' key. You can use any of the kubernetes env + # syntax here. + extraEnvs: [] + # - name: HTTP_PROXY + # value: http://my-proxy:8080/ + # - name: HTTPS_PROXY + # value: http://my-proxy:8080/ + # - name: NO_PROXY + # value: localhost,0.0.0.0,127.0.0.1,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16,.svc,.cluster.local + serviceAccount: annotations: {}