From e0a2811417fc6931f92867c499bdd80ba64d3c20 Mon Sep 17 00:00:00 2001 From: Lev Kokotov Date: Wed, 21 Jan 2026 10:55:10 -0800 Subject: [PATCH] feat: add control plane configuration and test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add test/values-control.yaml to validate pgdog control plane settings in CI. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- Chart.yaml | 2 +- templates/config.yaml | 13 +++++++++++++ test/values-control.yaml | 22 ++++++++++++++++++++++ values.yaml | 24 ++++++++++++++++++++++++ 4 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 test/values-control.yaml diff --git a/Chart.yaml b/Chart.yaml index bc7da1a..56f1389 100644 --- a/Chart.yaml +++ b/Chart.yaml @@ -1,4 +1,4 @@ apiVersion: v1 name: pgdog -version: v0.35 +version: v0.36 appVersion: "0.1.25" diff --git a/templates/config.yaml b/templates/config.yaml index 6adc500..c15a15e 100644 --- a/templates/config.yaml +++ b/templates/config.yaml @@ -248,3 +248,16 @@ data: max_errors = {{ .Values.queryStats.maxErrors | default "100" }} max_error_age = {{ .Values.queryStats.maxErrorAge | default "300_000" }} {{- end }} + + {{- if .Values.control.enabled }} + [control] + endpoint = {{ .Values.control.endpoint | quote }} + token = {{ .Values.control.token | quote }} + metrics_interval = {{ .Values.control.metricsInterval | default "1_000" }} + stats_interval = {{ .Values.control.statsInterval | default "5_000" }} + active_queries_interval = {{ .Values.control.activeQueriesInterval | default "5_000" }} + errors_interval = {{ .Values.control.errorsInterval | default "5_000" }} + request_timeout = {{ .Values.control.requestTimeout | default "1_000" }} + query_timings_chunk_size = {{ .Values.control.queryTimingsChunkSize | default "25" }} + query_timings_new_query_queue_size = {{ .Values.control.queryTimingsNewQueryQueueSize | default "1_000" }} + {{- end }} diff --git a/test/values-control.yaml b/test/values-control.yaml new file mode 100644 index 0000000..e1236f0 --- /dev/null +++ b/test/values-control.yaml @@ -0,0 +1,22 @@ +# Test control plane configuration (PgDog EE) +control: + enabled: true + endpoint: "wss://control.example.com/ws" + token: "test-token-12345" + metricsInterval: 2000 + statsInterval: 10000 + activeQueriesInterval: 5000 + errorsInterval: 5000 + requestTimeout: 2000 + queryTimingsChunkSize: 50 + queryTimingsNewQueryQueueSize: 500 + +# Basic database config for testing control integration +databases: + - name: primary + host: postgres.example.com + port: 5432 + +users: + - username: app_user + password: secret123 diff --git a/values.yaml b/values.yaml index a4dea3a..2d021e1 100644 --- a/values.yaml +++ b/values.yaml @@ -422,6 +422,30 @@ queryStats: queryPlansCache: 100 maxErrors: 100 maxErrorAge: 300000 +# Control configuration (PgDog EE) +# Enables communication with PgDog Cloud control plane +control: + # enabled controls whether to include [control] section in pgdog.toml + enabled: false + # endpoint is the control plane URL + endpoint: "" + # token is the authentication token for the control plane + token: "" + # metricsInterval defines how often to push metrics (in milliseconds) + metricsInterval: 1000 + # statsInterval defines how often to push stats (in milliseconds) + statsInterval: 5000 + # activeQueriesInterval defines how often to push active queries (in milliseconds) + activeQueriesInterval: 5000 + # errorsInterval defines how often to push errors (in milliseconds) + errorsInterval: 5000 + # requestTimeout defines the timeout for control plane requests (in milliseconds) + requestTimeout: 1000 + # queryTimingsChunkSize defines the chunk size for query timings + queryTimingsChunkSize: 25 + # queryTimingsNewQueryQueueSize defines the queue size for new query timings + queryTimingsNewQueryQueueSize: 1000 + # LSN check configuration for replication failover auto mode (in milliseconds) # See: https://docs.pgdog.dev/features/load-balancer/replication-failover/ # lsnCheckDelay: 0 # Set to 0 to start LSN monitoring immediately