From dc72ef6067d23699d0f778acd364d65e477bfd9f Mon Sep 17 00:00:00 2001 From: Lev Kokotov Date: Mon, 2 Feb 2026 12:31:13 -0800 Subject: [PATCH 1/5] Add support for env vars --- Chart.yaml | 2 +- templates/deployment.yaml | 5 +++++ test/values-full.yaml | 4 ++++ values.yaml | 13 +++++++++++++ 4 files changed, 23 insertions(+), 1 deletion(-) diff --git a/Chart.yaml b/Chart.yaml index cc70df8..fbf8a30 100644 --- a/Chart.yaml +++ b/Chart.yaml @@ -1,4 +1,4 @@ apiVersion: v1 name: pgdog -version: v0.39 +version: v0.40 appVersion: "0.1.26" diff --git a/templates/deployment.yaml b/templates/deployment.yaml index abbdebd..18902bf 100644 --- a/templates/deployment.yaml +++ b/templates/deployment.yaml @@ -66,6 +66,11 @@ spec: valueFrom: fieldRef: fieldPath: metadata.name + {{- range .Values.env }} + {{- if ne .name "NODE_ID" }} + - {{- toYaml . | nindent 14 }} + {{- end }} + {{- end }} ports: - name: pgdog containerPort: {{ .Values.port }} diff --git a/test/values-full.yaml b/test/values-full.yaml index 0dcf476..586497c 100644 --- a/test/values-full.yaml +++ b/test/values-full.yaml @@ -1,5 +1,9 @@ # Full configuration test with databases and users replicas: 3 + +env: + - name: RUST_LOG + value: trace queryParserEngine: "pg_query_raw" memoryNetBuffer: 8192 diff --git a/values.yaml b/values.yaml index 2d021e1..0ada9a4 100644 --- a/values.yaml +++ b/values.yaml @@ -68,6 +68,19 @@ statefulSet: # enabled switches from Deployment to StatefulSet enabled: false +# env allows setting custom environment variables on the pgdog container +# Note: NODE_ID is automatically generated and cannot be overridden +# Example: +# env: +# - name: MY_VAR +# value: "my-value" +# - name: SECRET_VAR +# valueFrom: +# secretKeyRef: +# name: my-secret +# key: password +env: [] + # Extra customization for advanced use cases # extraInitContainers allows adding custom init containers that run before the main pgdog container # Init containers are useful for setup tasks like downloading certificates, waiting for dependencies, etc. From 5b8cc9fd4a008dff575d63482dab57a83e09c48e Mon Sep 17 00:00:00 2001 From: Lev Kokotov Date: Mon, 2 Feb 2026 12:33:17 -0800 Subject: [PATCH 2/5] gateway is gone --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ff556f7..c973c23 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -79,7 +79,7 @@ jobs: sudo pip3 install cmake==3.31.6 - name: Build pgdog - run: cargo build --bin pgdog --bin gateway + run: cargo build --bin pgdog working-directory: pgdog-source - name: Validate configs From 3167e776d59474aa0a21b192c4f0ec0db4590344 Mon Sep 17 00:00:00 2001 From: Lev Kokotov Date: Mon, 2 Feb 2026 12:34:21 -0800 Subject: [PATCH 3/5] fix ci --- .github/workflows/test.yml | 7 ---- test/generate-gateway-config.sh | 27 -------------- test/values-gateway.yaml | 66 --------------------------------- 3 files changed, 100 deletions(-) delete mode 100644 test/generate-gateway-config.sh delete mode 100644 test/values-gateway.yaml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c973c23..5429bd8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -91,12 +91,5 @@ jobs: rm -f /tmp/pgdog.toml ./test/generate-config.sh "$values_file" /tmp/pgdog.toml ./pgdog-source/target/debug/pgdog --config=/tmp/pgdog.toml configcheck - - # Check if gateway is enabled and validate gateway config - rm -f /tmp/gateway.toml - if ./test/generate-gateway-config.sh "$values_file" /tmp/gateway.toml 2>/dev/null; then - echo "==> Validating gateway config for $name..." - ./pgdog-source/target/debug/gateway --config=/tmp/gateway.toml configcheck - fi done echo "==> All configs valid!" diff --git a/test/generate-gateway-config.sh b/test/generate-gateway-config.sh deleted file mode 100644 index 7cc4b05..0000000 --- a/test/generate-gateway-config.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash -set -eo pipefail - -TEST_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -CHART_DIR="$TEST_DIR/.." - -if [ -z "$1" ]; then - echo "Usage: $0 [output-file]" - echo "Example: $0 values-gateway.yaml gateway-config.toml" - exit 1 -fi - -VALUES_FILE="$1" - -output=$(helm template pgdog "$CHART_DIR" -f "$VALUES_FILE" \ - | yq -r 'select(.kind == "ConfigMap" and .metadata.name == "pgdog-gateway") | .data["config.toml"]') - -if [ -z "$output" ] || [ "$output" = "null" ]; then - echo "No gateway config found. Make sure gateway.enabled is true in your values file." - exit 1 -fi - -if [ -z "$2" ]; then - echo "$output" -else - echo "$output" > "$2" -fi diff --git a/test/values-gateway.yaml b/test/values-gateway.yaml deleted file mode 100644 index 8fe60e0..0000000 --- a/test/values-gateway.yaml +++ /dev/null @@ -1,66 +0,0 @@ -# Test gateway configuration (Enterprise Edition) -gateway: - enabled: true - port: 8443 - bindAddress: "0.0.0.0" - image: - repository: ghcr.io/pgdogdev/pgdog-enterprise/gateway - tag: "main-ent" - pullPolicy: Always - resources: - requests: - cpu: 500m - memory: 512Mi - limits: - cpu: 1000m - memory: 1Gi - tls: - existingSecret: "gateway-tls-secret" - control: - url: "wss://control.example.com/ws" - token: "test-token-12345" - stats: - activeQueriesInterval: 2000 - pingInterval: 1500 - pushInterval: 3000 - configInterval: 5000 - service: - type: ClusterIP - annotations: - service.beta.kubernetes.io/aws-load-balancer-internal: "true" - nodeSelector: - node-type: gateway - tolerations: - - key: dedicated - operator: Equal - value: gateway - effect: NoSchedule - affinity: - podAntiAffinity: - preferredDuringSchedulingIgnoredDuringExecution: - - weight: 100 - podAffinityTerm: - labelSelector: - matchLabels: - app: pgdog-gateway - topologyKey: kubernetes.io/hostname - connectFromPgdog: true - -# Enable query stats since gateway is enabled -queryStats: - enabled: true - queryPlanThreshold: 500 - queryPlanMaxAge: 30000 - queryPlansCache: 200 - maxErrors: 50 - maxErrorAge: 600000 - -# Basic database config for testing gateway integration -databases: - - name: primary - host: postgres.example.com - port: 5432 - -users: - - username: app_user - password: secret123 \ No newline at end of file From 29a8be77db85d89246b6496a0f5628e0727b4cc7 Mon Sep 17 00:00:00 2001 From: Lev Kokotov Date: Mon, 2 Feb 2026 12:38:04 -0800 Subject: [PATCH 4/5] move to blacksmith --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5429bd8..f816783 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,7 +8,7 @@ on: jobs: test: - runs-on: ubuntu-latest + runs-on: blacksmith-4vcpu-ubuntu-2404 steps: - name: Checkout repository From 318dc9a2368d292050fa371a8a43b3ff581456fd Mon Sep 17 00:00:00 2001 From: Lev Kokotov Date: Mon, 2 Feb 2026 12:39:49 -0800 Subject: [PATCH 5/5] move to bs --- .github/workflows/package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index 1f57033..e4faf24 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -9,7 +9,7 @@ env: jobs: release: - runs-on: ubuntu-latest + runs-on: blacksmith-4vcpu-ubuntu-2404 permissions: contents: read id-token: write