Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

helm: Add experimentalEnv settings #11908

Merged
merged 1 commit into from
Jan 12, 2024
Merged

helm: Add experimentalEnv settings #11908

merged 1 commit into from
Jan 12, 2024

Conversation

siggy
Copy link
Member

@siggy siggy commented Jan 10, 2024

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

@siggy siggy self-assigned this Jan 10, 2024
@siggy siggy requested a review from a team as a code owner January 10, 2024 01:53
@siggy siggy force-pushed the siggy/env branch 3 times, most recently from 2ecf917 to ea2ffa6 Compare January 10, 2024 16:00
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]>
@@ -208,6 +208,10 @@ spec:
{{- range (.Values.destinationController).experimentalArgs }}
- {{ . }}
{{- end }}
{{- with (.Values.destinationController).experimentalEnv }}
env:
{{- toYaml . | nindent 8 -}}
Copy link
Member

@olix0r olix0r Jan 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like these configurations work differently from those of the proxy's experimentalEnv settings which are expressed as objects instead of as lists of name/values. Is this intentional?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is intentional. It allows for things like this:

destinationController:
  experimentalEnv:
  - name: ENV_VAR
    valueFrom:
      configMapKeyRef:
        key: env-var-key
        name: my-config-map

@olix0r
Copy link
Member

olix0r commented Jan 12, 2024

We should probably follow-up to update the proxy settings to match this so they are consistent.

@mateiidavid mateiidavid merged commit f1f5367 into main Jan 12, 2024
36 checks passed
@mateiidavid mateiidavid deleted the siggy/env branch January 12, 2024 14:17
siggy added a commit that referenced this pull request Jan 12, 2024
PR #11874 introduced a `proxy.ExperimentalEnv` setting, allowing
arbitrary name+value environment variables on proxies. This name+value
pairing was a subset of k8s' environment variable, specifically, it did
not allow for `valueFrom.configMapKeyRef` and related fields. PR #11908
introduced this pattern in the ControlPlane containers.

Modify `proxy.ExperimentalEnv` to behave identically to k8s' native
`EnvVar`, allowing settings such as:
```
--set proxy.experimentalEnv[0].name=LINKERD2_PROXY_DEFROBINATION
--set proxy.experimentalEnv[0].valueFrom.configMapKeyRef.key=extreme-key
--set proxy.experimentalEnv[0].valueFrom.configMapKeyRef.name=extreme-config
```

Context:
#11908 (comment)

Signed-off-by: Andrew Seigner <[email protected]>
siggy added a commit that referenced this pull request Jan 12, 2024
PR #11874 introduced a `proxy.ExperimentalEnv` setting, allowing
arbitrary name+value environment variables on proxies. This name+value
pairing was a subset of k8s' environment variable, specifically, it did
not allow for `valueFrom.configMapKeyRef` and related fields. PR #11908
introduced this pattern in the ControlPlane containers.

Modify `proxy.ExperimentalEnv` to behave identically to k8s' native
`EnvVar`, allowing settings such as:
```
--set proxy.experimentalEnv[0].name=LINKERD2_PROXY_DEFROBINATION
--set proxy.experimentalEnv[0].valueFrom.configMapKeyRef.key=extreme-key
--set proxy.experimentalEnv[0].valueFrom.configMapKeyRef.name=extreme-config
```

Context:
#11908 (comment)

Signed-off-by: Andrew Seigner <[email protected]>
siggy added a commit that referenced this pull request Jan 12, 2024
PR #11874 introduced a `proxy.ExperimentalEnv` setting, allowing
arbitrary name+value environment variables on proxies. This name+value
pairing was a subset of k8s' environment variables, specifically, it did
not allow for `valueFrom.configMapKeyRef` and related fields. PR #11908
introduced this pattern in the ControlPlane containers.

Modify `proxy.ExperimentalEnv` to behave identically to k8s' native
`EnvVar`, allowing settings such as:
```
--set proxy.experimentalEnv[0].name=LINKERD2_PROXY_DEFROBINATION
--set proxy.experimentalEnv[0].valueFrom.configMapKeyRef.key=extreme-key
--set proxy.experimentalEnv[0].valueFrom.configMapKeyRef.name=extreme-config
```

Context:
#11908 (comment)

Signed-off-by: Andrew Seigner <[email protected]>
siggy added a commit that referenced this pull request Jan 14, 2024
PR #11874 introduced a `proxy.ExperimentalEnv` setting, allowing
arbitrary name+value environment variables on proxies. This name+value
pairing was a subset of k8s' environment variables, specifically, it did
not allow for `valueFrom.configMapKeyRef` and related fields. PR #11908
introduced this pattern in the ControlPlane containers.

Modify `proxy.ExperimentalEnv` to behave identically to k8s' native
`EnvVar`, allowing settings such as:
```
--set proxy.experimentalEnv[0].name=LINKERD2_PROXY_DEFROBINATION
--set proxy.experimentalEnv[0].valueFrom.configMapKeyRef.key=extreme-key
--set proxy.experimentalEnv[0].valueFrom.configMapKeyRef.name=extreme-config
```

Context:
#11908 (comment)

Signed-off-by: Andrew Seigner <[email protected]>
mateiidavid pushed a commit that referenced this pull request Jan 15, 2024
PR #11874 introduced a `proxy.ExperimentalEnv` setting, allowing
arbitrary name+value environment variables on proxies. This name+value
pairing was a subset of k8s' environment variables, specifically, it did
not allow for `valueFrom.configMapKeyRef` and related fields. PR #11908
introduced this pattern in the ControlPlane containers.

Modify `proxy.ExperimentalEnv` to behave identically to k8s' native
`EnvVar`, allowing settings such as:
```
--set proxy.experimentalEnv[0].name=LINKERD2_PROXY_DEFROBINATION
--set proxy.experimentalEnv[0].valueFrom.configMapKeyRef.key=extreme-key
--set proxy.experimentalEnv[0].valueFrom.configMapKeyRef.name=extreme-config
```

Context:
#11908 (comment)

Signed-off-by: Andrew Seigner <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants