From eb0fbe04d5c4f089511249bd32b65dc1c7b6fffe Mon Sep 17 00:00:00 2001 From: Lev Kokotov Date: Thu, 12 Mar 2026 18:56:39 -0700 Subject: [PATCH 1/2] feat: support configuring plugins --- Chart.yaml | 2 +- templates/config.yaml | 14 ++++++++++++++ test/values-full.yaml | 7 +++++++ test/values-plugins.yaml | 12 ++++++++++++ values.yaml | 13 +++++++++++++ 5 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 test/values-plugins.yaml diff --git a/Chart.yaml b/Chart.yaml index 64026b9..9774a1a 100644 --- a/Chart.yaml +++ b/Chart.yaml @@ -1,4 +1,4 @@ apiVersion: v1 name: pgdog -version: v0.45 +version: v0.46 appVersion: "0.1.30" diff --git a/templates/config.yaml b/templates/config.yaml index 3034316..1f132ba 100644 --- a/templates/config.yaml +++ b/templates/config.yaml @@ -237,6 +237,14 @@ data: tables = {{ .tables | toToml }} {{- end }} + {{- range .Values.plugins }} + [[plugins]] + name = {{ .name | quote }} + {{- if .config }} + config = "/etc/pgdog/{{ .name }}.toml" + {{- end }} + {{- end }} + {{- if or (hasKey .Values "tcpKeepalive") (hasKey .Values "tcpTime") (hasKey .Values "tcpInterval") (hasKey .Values "tcpRetries") }} [tcp] {{- if hasKey .Values "tcpKeepalive" }} @@ -307,3 +315,9 @@ data: split_inserts = {{ .Values.rewrite.splitInserts | default "error" | quote }} primary_key = {{ .Values.rewrite.primaryKey | default "ignore" | quote }} {{- end }} + {{- range .Values.plugins }} + {{- if .config }} + {{ .name }}.toml: | +{{ .config | indent 8 }} + {{- end }} + {{- end }} diff --git a/test/values-full.yaml b/test/values-full.yaml index f3904be..feffb36 100644 --- a/test/values-full.yaml +++ b/test/values-full.yaml @@ -57,6 +57,13 @@ omnishardedTables: - pg_constraint - pg_namespace +plugins: + - name: pgdog_routing + config: | + [routing] + key = "value" + - name: pgdog_auth + podAnnotations: prometheus.io/scrape: "true" diff --git a/test/values-plugins.yaml b/test/values-plugins.yaml new file mode 100644 index 0000000..aa6a8fe --- /dev/null +++ b/test/values-plugins.yaml @@ -0,0 +1,12 @@ +# Plugins configuration test +databases: + - name: primary + host: postgres-primary.example.com + port: 5432 + +plugins: + - name: pgdog_routing + config: | + [routing] + key = "value" + - name: pgdog_auth diff --git a/values.yaml b/values.yaml index 38d2294..dc0ebd9 100644 --- a/values.yaml +++ b/values.yaml @@ -210,6 +210,19 @@ shardedMappings: [] # - "pg_index" omnishardedTables: [] +# plugins contains the list of plugin entries in pgdog.toml +# Each entry requires: name; config is optional (inline TOML content) +# When config is provided, a .toml file is added to the ConfigMap +# and the plugin config path is set to /etc/pgdog/.toml +# Example: +# plugins: +# - name: "pgdog_routing" +# config: | +# [routing] +# key = "value" +# - name: "pgdog_auth" +plugins: [] + # service contains the Kubernetes service configuration service: # type specifies the type of Kubernetes service From dd26d6fefab38300a1304e2d9821df3f4460d3e4 Mon Sep 17 00:00:00 2001 From: Lev Kokotov Date: Thu, 12 Mar 2026 18:57:41 -0700 Subject: [PATCH 2/2] readme --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index efeb695..c3aa420 100644 --- a/README.md +++ b/README.md @@ -249,6 +249,22 @@ The `queueConfig` settings use Prometheus defaults and can be tuned for performance. Remote write is automatically enabled when `url` is set. +### Plugins + +Add plugins to the `plugins` list. Each plugin requires a `name`; `config` is +optional and accepts inline TOML content. When `config` is provided, a +`.toml` file is added to the ConfigMap and mounted at +`/etc/pgdog/.toml`. + +```yaml +plugins: + - name: pgdog_routing + config: | + [routing] + key = "value" + - name: pgdog_auth +``` + ### TCP Keep-Alive Configuration Configure socket-level TCP keep-alive behavior (optional):