Skip to content

Commit 2876208

Browse files
authored
Add support for env vars (#68)
* Add support for env vars * gateway is gone * fix ci * move to blacksmith * move to bs
1 parent 726d015 commit 2876208

8 files changed

Lines changed: 26 additions & 104 deletions

File tree

.github/workflows/package.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ env:
99

1010
jobs:
1111
release:
12-
runs-on: ubuntu-latest
12+
runs-on: blacksmith-4vcpu-ubuntu-2404
1313
permissions:
1414
contents: read
1515
id-token: write

.github/workflows/test.yml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88

99
jobs:
1010
test:
11-
runs-on: ubuntu-latest
11+
runs-on: blacksmith-4vcpu-ubuntu-2404
1212

1313
steps:
1414
- name: Checkout repository
@@ -79,7 +79,7 @@ jobs:
7979
sudo pip3 install cmake==3.31.6
8080
8181
- name: Build pgdog
82-
run: cargo build --bin pgdog --bin gateway
82+
run: cargo build --bin pgdog
8383
working-directory: pgdog-source
8484

8585
- name: Validate configs
@@ -91,12 +91,5 @@ jobs:
9191
rm -f /tmp/pgdog.toml
9292
./test/generate-config.sh "$values_file" /tmp/pgdog.toml
9393
./pgdog-source/target/debug/pgdog --config=/tmp/pgdog.toml configcheck
94-
95-
# Check if gateway is enabled and validate gateway config
96-
rm -f /tmp/gateway.toml
97-
if ./test/generate-gateway-config.sh "$values_file" /tmp/gateway.toml 2>/dev/null; then
98-
echo "==> Validating gateway config for $name..."
99-
./pgdog-source/target/debug/gateway --config=/tmp/gateway.toml configcheck
100-
fi
10194
done
10295
echo "==> All configs valid!"

Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
apiVersion: v1
22
name: pgdog
3-
version: v0.39
3+
version: v0.40
44
appVersion: "0.1.26"

templates/deployment.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,11 @@ spec:
6666
valueFrom:
6767
fieldRef:
6868
fieldPath: metadata.name
69+
{{- range .Values.env }}
70+
{{- if ne .name "NODE_ID" }}
71+
- {{- toYaml . | nindent 14 }}
72+
{{- end }}
73+
{{- end }}
6974
ports:
7075
- name: pgdog
7176
containerPort: {{ .Values.port }}

test/generate-gateway-config.sh

Lines changed: 0 additions & 27 deletions
This file was deleted.

test/values-full.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Full configuration test with databases and users
22
replicas: 3
3+
4+
env:
5+
- name: RUST_LOG
6+
value: trace
37
queryParserEngine: "pg_query_raw"
48

59
memoryNetBuffer: 8192

test/values-gateway.yaml

Lines changed: 0 additions & 66 deletions
This file was deleted.

values.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,19 @@ statefulSet:
6868
# enabled switches from Deployment to StatefulSet
6969
enabled: false
7070

71+
# env allows setting custom environment variables on the pgdog container
72+
# Note: NODE_ID is automatically generated and cannot be overridden
73+
# Example:
74+
# env:
75+
# - name: MY_VAR
76+
# value: "my-value"
77+
# - name: SECRET_VAR
78+
# valueFrom:
79+
# secretKeyRef:
80+
# name: my-secret
81+
# key: password
82+
env: []
83+
7184
# Extra customization for advanced use cases
7285
# extraInitContainers allows adding custom init containers that run before the main pgdog container
7386
# Init containers are useful for setup tasks like downloading certificates, waiting for dependencies, etc.

0 commit comments

Comments
 (0)