Skip to content

Commit 0f1df61

Browse files
committed
Add ability to set env values for the trino-gateway
1 parent 8d70741 commit 0f1df61

File tree

4 files changed

+24
-1
lines changed

4 files changed

+24
-1
lines changed

charts/gateway/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,14 @@ A Helm chart for Trino Gateway
3737
- secretRef:
3838
name: password-secret
3939
```
40+
* `env` - list, default: `[]`
41+
42+
Additional environment variables to mount into the init container as environment variables.
43+
Example:
44+
```yaml
45+
- name: NAME
46+
value: "value"
47+
```
4048
* `config.serverConfig."node.environment"` - string, default: `"test"`
4149
* `config.serverConfig."http-server.http.port"` - int, default: `8080`
4250
* `config.dataStore.jdbcUrl` - string, default: `"jdbc:postgresql://localhost:5432/gateway"`

charts/gateway/templates/deployment.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ spec:
3838
imagePullPolicy: {{ .Values.image.pullPolicy }}
3939
command:
4040
{{- toYaml .Values.command | nindent 12}}
41+
env:
42+
{{- toYaml .Values.env | nindent 12}}
4143
envFrom:
4244
{{- toYaml .Values.envFrom | nindent 12}}
4345
ports:

charts/gateway/values.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,15 @@ imagePullSecrets: []
3030
# ```
3131
envFrom: []
3232

33+
# env -- Additional environment variables to mount into the init container as environment variables.
34+
# @raw
35+
# Example:
36+
# ```yaml
37+
# - name: NAME
38+
# value: "value"
39+
# ```
40+
env: []
41+
3342
config:
3443
serverConfig:
3544
node.environment: test

tests/gateway/test-values-with-env.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ config:
1111
http-server.http.port: 8080
1212
dataStore:
1313
# The connection details for the backend database for Trino Gateway and Trino query history
14-
jdbcUrl: jdbc:postgresql://gateway-backend-db-postgresql.postgres-gateway.svc.cluster.local:5432/gateway
14+
jdbcUrl: jdbc:postgresql://${ENV:PG_HOST}:5432/gateway
1515
user: "${ENV:PG_USER}"
1616
password: "${ENV:PG_PASSWORD}"
1717
driver: org.postgresql.Driver
@@ -28,6 +28,10 @@ envFrom:
2828
- secretRef:
2929
name: db-credentials
3030

31+
env:
32+
- name: PG_HOST
33+
value: gateway-backend-db-postgresql.postgres-gateway.svc.cluster.local
34+
3135
resources:
3236
limits:
3337
cpu: 500m

0 commit comments

Comments
 (0)