File tree Expand file tree Collapse file tree 6 files changed +62
-50
lines changed Expand file tree Collapse file tree 6 files changed +62
-50
lines changed Original file line number Diff line number Diff line change @@ -28,15 +28,15 @@ A Helm chart for Trino Gateway
28
28
imagePullSecrets :
29
29
- name : registry-credentials
30
30
` ` `
31
- * ` dataStoreSecret ` - object , default: `{"key":"","name":""} `
31
+ * ` envFrom ` - list , default: `[] `
32
32
33
- Provide configuration for the Trino Gateway `dataStore` in `dataStoreSecret`. This node can be left undefined if `dataStore` is defined under the config node. For production deployments sensitive values should be stored in a Secret
34
- * `backendStateSecret` - object, default: `{"key":"","name":""}`
35
-
36
- Provide configuration for the Trino Gateway `backendState` in `backendStateSecret`. This should be used with health check configurations that require backend credentials. This node can be left undefined if `dataStore` is defined under the config node.
37
- * `authenticationSecret` - object, default: `{"key":"","name":""}`
38
-
39
- Provide configuration for the Trino Gateway authentication configuration in `authenticationSecret`. This node can be left undefined if `dataStore` is defined under the config node.
33
+ A list of secrets and configmaps to mount into the init container as environment variables.
34
+ Example :
35
+ ` ` ` yaml
36
+ envFrom:
37
+ - secretRef:
38
+ name: password-secret
39
+ ` ` `
40
40
* `config.serverConfig."node.environment"` - string, default: `"test"`
41
41
* `config.serverConfig."http-server.http.port"` - int, default: `8080`
42
42
* `config.dataStore.jdbcUrl` - string, default: `"jdbc:postgresql://localhost:5432/gateway"`
Original file line number Diff line number Diff line change 14
14
template :
15
15
metadata :
16
16
annotations :
17
- # Include the version of trino-gateway-configuration as an input to the
18
- # deployment checksum. This causes pods to restart on helm update
19
- # whether the chart `config` is updated or if one of the configuration
20
- # secrets is updated. Helm template must be run with the
21
- # --dry-run=server option to prevent a nil pointer.
22
- checksum/config : {{ (coalesce (lookup "v1" "Secret" .Release.Namespace "trino-gateway-configuration").metadata (dict "resourceVersion" "0")).resourceVersion | sha256sum}}
23
17
{{- with .Values.podAnnotations }}
24
18
{{- toYaml . | nindent 8 }}
25
19
{{- end }}
44
38
imagePullPolicy : {{ .Values.image.pullPolicy }}
45
39
command :
46
40
{{- toYaml .Values.command | nindent 12}}
41
+ envFrom :
42
+ {{- toYaml .Values.envFrom | nindent 12}}
47
43
ports :
48
44
- name : request
49
45
containerPort : {{ index .Values "config" "serverConfig" "http-server.http.port" }}
Original file line number Diff line number Diff line change 1
- {{ $dataStoreDict := dict}}
2
- {{ if .Values.dataStoreSecret.name }}
3
- {{ $dataStoreDict = (index (lookup "v1" "Secret" .Release.Namespace .Values.dataStoreSecret.name).data .Values.dataStoreSecret.key) | b64dec | fromYaml }}
4
- {{ end }}
5
- {{ $backendStateDict := dict }}
6
- {{ if .Values.backendStateSecret.name }}
7
- {{ $backendStateDict = (index (lookup "v1" "Secret" .Release.Namespace .Values.backendStateSecret.name).data .Values.backendStateSecret.key) | b64dec | fromYaml }}
8
- {{ end }}
9
- {{ $authenticationDict := dict }}
10
- {{ if .Values.authenticationSecret.name }}
11
- # {{.Values.authenticationSecret.name }} #
12
- # {{ index (lookup "v1" "Secret" .Release.Namespace .Values.authenticationSecret.name).data .Values.authenticationSecret.key }} #
13
- {{ $authenticationDict = (index (lookup "v1" "Secret" .Release.Namespace .Values.authenticationSecret.name).data .Values.authenticationSecret.key) | b64dec | fromYaml }}
14
- {{ end }}
15
-
16
1
apiVersion : v1
17
2
kind : Secret
18
3
metadata :
19
4
name : trino-gateway-configuration
20
5
type : " Opaque"
21
6
data :
22
- config.yaml : " {{toYaml (merge .Values.config $authenticationDict $dataStoreDict $backendStateDict ) | b64enc}}"
7
+ config.yaml : " {{toYaml .Values.config | b64enc}}"
Original file line number Diff line number Diff line change @@ -20,25 +20,15 @@ image:
20
20
# ```
21
21
imagePullSecrets : []
22
22
23
- # -- Provide configuration for the Trino Gateway `dataStore` in `dataStoreSecret`. This node can
24
- # be left undefined if `dataStore` is defined under the config node. For production deployments
25
- # sensitive values should be stored in a Secret
26
- dataStoreSecret :
27
- name : " "
28
- key : " "
29
-
30
- # -- Provide configuration for the Trino Gateway `backendState` in `backendStateSecret`. This should
31
- # be used with health check configurations that require backend credentials. This node can
32
- # be left undefined if `dataStore` is defined under the config node.
33
- backendStateSecret :
34
- name : " "
35
- key : " "
36
-
37
- # -- Provide configuration for the Trino Gateway authentication configuration in `authenticationSecret`.
38
- # This node can be left undefined if `dataStore` is defined under the config node.
39
- authenticationSecret :
40
- name : " "
41
- key : " "
23
+ # -- A list of secrets and configmaps to mount into the init container as environment variables.
24
+ # @raw
25
+ # Example:
26
+ # ```yaml
27
+ # envFrom:
28
+ # - secretRef:
29
+ # name: password-secret
30
+ # ```
31
+ envFrom : []
42
32
43
33
config :
44
34
serverConfig :
Original file line number Diff line number Diff line change
1
+ replicaCount : 1
2
+
3
+ image :
4
+ # -- Repository location of the Trino Gateway image, typically `organization/imagename`
5
+ repository : " trinodb/trino-gateway"
6
+ pullPolicy : IfNotPresent
7
+
8
+ config :
9
+ serverConfig :
10
+ node.environment : test
11
+ http-server.http.port : 8080
12
+ dataStore :
13
+ # 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
15
+ user : " ${ENV:PG_USER}"
16
+ password : " ${ENV:PG_PASSWORD}"
17
+ driver : org.postgresql.Driver
18
+ clusterStatsConfiguration :
19
+ monitorType : INFO_API
20
+ modules :
21
+ - io.trino.gateway.ha.module.HaGatewayProviderModule
22
+ - io.trino.gateway.ha.module.ClusterStateListenerModule
23
+ - io.trino.gateway.ha.module.ClusterStatsMonitorModule
24
+ managedApps :
25
+ - io.trino.gateway.ha.clustermonitor.ActiveClusterMonitor
26
+
27
+ envFrom :
28
+ - secretRef :
29
+ name : db-credentials
30
+
31
+ resources :
32
+ limits :
33
+ cpu : 500m
34
+ memory : 256Mi
35
+ requests :
36
+ cpu : 250m
37
+ memory : 256Mi
Original file line number Diff line number Diff line change @@ -4,10 +4,12 @@ set -euo pipefail
4
4
5
5
declare -A testCases=(
6
6
[complete_values]=" --values test-values.yaml"
7
+ [env_from]=" --values test-values-with-env.yaml"
7
8
)
8
9
9
10
declare -A testCaseCharts=(
10
11
[complete_values]=" ../../charts/gateway"
12
+ [env_from]=" ../../charts/gateway"
11
13
)
12
14
13
15
function join_by {
@@ -28,7 +30,7 @@ CT_ARGS=(
28
30
--helm-extra-args=" --timeout 2m"
29
31
)
30
32
CLEANUP_NAMESPACE=true
31
- TEST_NAMES=(complete_values)
33
+ TEST_NAMES=(complete_values env_from )
32
34
33
35
usage () {
34
36
cat << EOF 1>&2
@@ -87,6 +89,8 @@ helm upgrade --install ${DB_INSTALLATION_NAME} oci://registry-1.docker.io/bitnam
87
89
--set primary.persistence.enabled=false
88
90
kubectl wait --for=condition=ready pod -l app.kubernetes.io/name=postgresql --timeout=300s -n " $DB_NAMESPACE "
89
91
92
+ kubectl --namespace " $NAMESPACE " create secret generic db-credentials --from-literal=PG_USER=' gateway' --from-literal=PG_PASSWORD=' pass0000'
93
+
90
94
result=0
91
95
for test_name in " ${TEST_NAMES[@]} " ; do
92
96
echo 1>&2 " "
You can’t perform that action at this time.
0 commit comments