Skip to content

Commit a056d44

Browse files
authored
feat: add extraEnv support to envoy-gateway controller deployment (#8733)
* feat: add extraEnv support to envoy-gateway controller deployment Add deployment.envoyGateway.extraEnv to the gateway-helm chart values, allowing operators to inject additional environment variables into the controller container. The controller deployment template currently hardcodes two env vars (ENVOY_GATEWAY_NAMESPACE and KUBERNETES_CLUSTER_DOMAIN) with no way to add more. This makes it impossible to configure behavior controlled by standard environment variables (e.g. OTEL_METRICS_EXEMPLAR_FILTER, GOGC, GOMEMLIMIT) without patching the deployment out-of-band. Fixes #8732 Signed-off-by: Giri Kuncoro <girikuncoro@gmail.com>
1 parent 85e62dd commit a056d44

6 files changed

Lines changed: 725 additions & 0 deletions

File tree

charts/gateway-helm/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ helm uninstall eg -n envoy-gateway-system
7070
| config.envoyGateway | object | `{"extensionApis":{},"gateway":{"controllerName":"gateway.envoyproxy.io/gatewayclass-controller"},"logging":{"level":{"default":"info"}},"provider":{"type":"Kubernetes"}}` | EnvoyGateway configuration. Visit https://gateway.envoyproxy.io/docs/api/extension_types/#envoygateway to view all options. |
7171
| createNamespace | bool | `false` | |
7272
| deployment.annotations | object | `{}` | |
73+
| deployment.envoyGateway.extraEnv | list | `[]` | Additional environment variables for the envoy-gateway container. |
7374
| deployment.envoyGateway.image.repository | string | `""` | |
7475
| deployment.envoyGateway.image.tag | string | `""` | |
7576
| deployment.envoyGateway.imagePullPolicy | string | `""` | |

charts/gateway-helm/templates/envoy-gateway-deployment.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ spec:
5959
fieldPath: metadata.namespace
6060
- name: KUBERNETES_CLUSTER_DOMAIN
6161
value: {{ .Values.kubernetesClusterDomain }}
62+
{{- with .Values.deployment.envoyGateway.extraEnv }}
63+
{{- toYaml . | nindent 8 }}
64+
{{- end }}
6265
image: {{ include "eg.image" . }}
6366
imagePullPolicy: {{ include "eg.image.pullPolicy" . }}
6467
livenessProbe:

charts/gateway-helm/values.tmpl.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ deployment:
4242
tag: ""
4343
imagePullPolicy: ""
4444
imagePullSecrets: []
45+
# -- Additional environment variables for the envoy-gateway container.
46+
extraEnv: []
4547
resources:
4648
limits:
4749
memory: 1024Mi

site/content/en/latest/install/gateway-helm-api.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ The Helm chart for Envoy Gateway
3434
| config.envoyGateway | object | `{"extensionApis":{},"gateway":{"controllerName":"gateway.envoyproxy.io/gatewayclass-controller"},"logging":{"level":{"default":"info"}},"provider":{"type":"Kubernetes"}}` | EnvoyGateway configuration. Visit https://gateway.envoyproxy.io/docs/api/extension_types/#envoygateway to view all options. |
3535
| createNamespace | bool | `false` | |
3636
| deployment.annotations | object | `{}` | |
37+
| deployment.envoyGateway.extraEnv | list | `[]` | Additional environment variables for the envoy-gateway container. |
3738
| deployment.envoyGateway.image.repository | string | `""` | |
3839
| deployment.envoyGateway.image.tag | string | `""` | |
3940
| deployment.envoyGateway.imagePullPolicy | string | `""` | |
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
global:
2+
images:
3+
envoyGateway:
4+
image: "docker.io/envoyproxy/gateway-dev:latest"
5+
pullPolicy: Always
6+
7+
deployment:
8+
envoyGateway:
9+
extraEnv:
10+
- name: OTEL_METRICS_EXEMPLAR_FILTER
11+
value: always_off
12+
- name: GOGC
13+
value: "50"

0 commit comments

Comments
 (0)