Skip to content

Commit

Permalink
Add ability to set env values for the trino-gateway
Browse files Browse the repository at this point in the history
  • Loading branch information
arturmkr committed Jan 8, 2025
1 parent 8d70741 commit 0f1df61
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 1 deletion.
8 changes: 8 additions & 0 deletions charts/gateway/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ A Helm chart for Trino Gateway
- secretRef:
name: password-secret
```
* `env` - list, default: `[]`

Additional environment variables to mount into the init container as environment variables.
Example:
```yaml
- name: NAME
value: "value"
```
* `config.serverConfig."node.environment"` - string, default: `"test"`
* `config.serverConfig."http-server.http.port"` - int, default: `8080`
* `config.dataStore.jdbcUrl` - string, default: `"jdbc:postgresql://localhost:5432/gateway"`
Expand Down
2 changes: 2 additions & 0 deletions charts/gateway/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ spec:
imagePullPolicy: {{ .Values.image.pullPolicy }}
command:
{{- toYaml .Values.command | nindent 12}}
env:
{{- toYaml .Values.env | nindent 12}}
envFrom:
{{- toYaml .Values.envFrom | nindent 12}}
ports:
Expand Down
9 changes: 9 additions & 0 deletions charts/gateway/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,15 @@ imagePullSecrets: []
# ```
envFrom: []

# env -- Additional environment variables to mount into the init container as environment variables.
# @raw
# Example:
# ```yaml
# - name: NAME
# value: "value"
# ```
env: []

config:
serverConfig:
node.environment: test
Expand Down
6 changes: 5 additions & 1 deletion tests/gateway/test-values-with-env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ config:
http-server.http.port: 8080
dataStore:
# The connection details for the backend database for Trino Gateway and Trino query history
jdbcUrl: jdbc:postgresql://gateway-backend-db-postgresql.postgres-gateway.svc.cluster.local:5432/gateway
jdbcUrl: jdbc:postgresql://${ENV:PG_HOST}:5432/gateway
user: "${ENV:PG_USER}"
password: "${ENV:PG_PASSWORD}"
driver: org.postgresql.Driver
Expand All @@ -28,6 +28,10 @@ envFrom:
- secretRef:
name: db-credentials

env:
- name: PG_HOST
value: gateway-backend-db-postgresql.postgres-gateway.svc.cluster.local

resources:
limits:
cpu: 500m
Expand Down

0 comments on commit 0f1df61

Please sign in to comment.