diff --git a/charts/gateway/README.md b/charts/gateway/README.md index 00e780f2..7c5990f0 100644 --- a/charts/gateway/README.md +++ b/charts/gateway/README.md @@ -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"` diff --git a/charts/gateway/templates/deployment.yaml b/charts/gateway/templates/deployment.yaml index 8ca31952..e0689f39 100644 --- a/charts/gateway/templates/deployment.yaml +++ b/charts/gateway/templates/deployment.yaml @@ -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: diff --git a/charts/gateway/values.yaml b/charts/gateway/values.yaml index 9eabc67e..65aaa795 100644 --- a/charts/gateway/values.yaml +++ b/charts/gateway/values.yaml @@ -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 diff --git a/tests/gateway/test-values-with-env.yaml b/tests/gateway/test-values-with-env.yaml index c58a470a..1184a434 100644 --- a/tests/gateway/test-values-with-env.yaml +++ b/tests/gateway/test-values-with-env.yaml @@ -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 @@ -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