Skip to content

Commit

Permalink
helm: Add experimentalEnv settings
Browse files Browse the repository at this point in the history
Enable setting arbitrary environment variables on all Go-based Control
Plane containers

For example, via CLI:

```
--set destinationController.experimentalEnv[0].name=ENV_VAR,destinationController.experimentalEnv[0].value=ENV_VAL
```

Via values file:

```
destinationController:
  experimentalEnv:
  - name: DEST_ENV_VAR
    value: DEST_ENV_VAL
  - name: DEST_CONFIG_MAP_VAR
    valueFrom:
      configMapKeyRef:
        key: dest_config_map_key
        name: dest-config-map-name
heartbeat:
  experimentalEnv:
identity:
  experimentalEnv:
proxyInjector:
  experimentalEnv:
spValidator:
  experimentalEnv:

serviceMirrorExperimentalEnv:
```

Relates to #11862 and #11874

Signed-off-by: Andrew Seigner <[email protected]>
  • Loading branch information
siggy committed Jan 10, 2024
1 parent 5e32446 commit e69f845
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 0 deletions.
8 changes: 8 additions & 0 deletions charts/linkerd-control-plane/templates/destination.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,10 @@ spec:
{{- range (.Values.destinationController).experimentalArgs }}
- {{ . }}
{{- end }}
{{- with (.Values.destinationController).experimentalEnv }}
env:
{{- toYaml . | nindent 8 -}}
{{- end }}
{{- include "partials.linkerd.trace" . | nindent 8 -}}
image: {{.Values.controllerImage}}:{{.Values.controllerImageVersion | default .Values.linkerdVersion}}
imagePullPolicy: {{.Values.imagePullPolicy}}
Expand Down Expand Up @@ -245,6 +249,10 @@ spec:
- -log-level={{.Values.controllerLogLevel}}
- -log-format={{.Values.controllerLogFormat}}
- -enable-pprof={{.Values.enablePprof | default false}}
{{- with (.Values.spValidator).experimentalEnv }}
env:
{{- toYaml . | nindent 8 -}}
{{- end }}
image: {{.Values.controllerImage}}:{{.Values.controllerImageVersion | default .Values.linkerdVersion}}
imagePullPolicy: {{.Values.imagePullPolicy}}
livenessProbe:
Expand Down
3 changes: 3 additions & 0 deletions charts/linkerd-control-plane/templates/heartbeat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ spec:
env:
- name: LINKERD_DISABLED
value: "the heartbeat controller does not use the proxy"
{{- with (.Values.heartbeat).experimentalEnv }}
{{- toYaml . | nindent 12 -}}
{{- end }}
args:
- "heartbeat"
- "-controller-namespace={{.Release.Namespace}}"
Expand Down
3 changes: 3 additions & 0 deletions charts/linkerd-control-plane/templates/identity.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,9 @@ spec:
env:
- name: LINKERD_DISABLED
value: "linkerd-await cannot block the identity controller"
{{- with (.Values.identity).experimentalEnv }}
{{- toYaml . | nindent 8 -}}
{{- end }}
image: {{.Values.controllerImage}}:{{.Values.controllerImageVersion | default .Values.linkerdVersion}}
imagePullPolicy: {{.Values.imagePullPolicy}}
livenessProbe:
Expand Down
4 changes: 4 additions & 0 deletions charts/linkerd-control-plane/templates/proxy-injector.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ spec:
- -log-format={{.Values.controllerLogFormat}}
- -linkerd-namespace={{.Release.Namespace}}
- -enable-pprof={{.Values.enablePprof | default false}}
{{- with (.Values.proxyInjector).experimentalEnv }}
env:
{{- toYaml . | nindent 8 -}}
{{- end }}
image: {{.Values.controllerImage}}:{{.Values.controllerImageVersion | default .Values.linkerdVersion}}
imagePullPolicy: {{.Values.imagePullPolicy}}
livenessProbe:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@ spec:
{{- end }}
- -enable-pprof={{.Values.enablePprof | default false}}
- {{.Values.targetClusterName}}
{{- with .Values.serviceMirrorExperimentalEnv }}
env:
{{- toYaml . | nindent 8 -}}
{{- end }}
image: {{.Values.controllerImage}}:{{.Values.controllerImageVersion}}
name: service-mirror
securityContext:
Expand Down

0 comments on commit e69f845

Please sign in to comment.