feat: support pgdog.toml from an existing Secret (configSecret) - #128
Merged
Conversation
Add a configSecret value mirroring usersSecret: when configSecret.name is set, the config volume is sourced from that existing Secret (with the key remapped to pgdog.toml) instead of the chart-rendered ConfigMap, which is then skipped entirely. This makes it possible to run pgdog when pgdog.toml contains values that must not live in a ConfigMap, e.g. database hosts and the admin password rendered from a secrets manager (External Secrets, sealed-secrets, SOPS). Overlaying such a file on top of the chart's ConfigMap with a subPath volume mount is not an option: the mount target is a symlink inside the ConfigMap volume and container runtimes reject the mount at pod start (kubernetes/kubernetes#61545), so swapping the volume source is the only way to provide the whole file. All parameters optional; default rendering is unchanged. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
levkk
reviewed
Aug 12, 2026
| exit 1 | ||
| fi | ||
|
|
||
| # Validate configSecret swaps the config volume source and skips the ConfigMap |
Contributor
There was a problem hiding this comment.
Let's remove this, claude keeps trying to add tests here, but this is not how we want this repo to be tested imo.
If you add a yaml into test directory, it will be automatically rendered and checked for validity (with helm).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
mscrivo
marked this pull request as ready for review
August 12, 2026 19:20
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
We run pgdog against databases whose hosts and admin credentials live in AWS Secrets Manager, rendered into a complete
pgdog.tomlby External Secrets Operator. That file can't go through chart values — it would put credentials into the ConfigMap — and overlaying it on the chart's copy with asubPathvolume mount fails at container start withnot a directory: the mount target/etc/pgdog/pgdog.tomlis a symlink inside the ConfigMap volume, and container runtimes refuse to bind a file over it (kubernetes/kubernetes#61545). As published, there's no working way to feed the chart a Secret-sourcedpgdog.toml.What this does
Adds a
configSecretvalue mirroring the existingusersSecretpattern:When
configSecret.nameis set:configvolume is sourced from that Secret instead of the chart's ConfigMap (customkeyremapped topgdog.toml, same asusersSecret)usersSecretgives the users Secret)All parameters optional; default rendering is unchanged.
Notes
plugins[].configentries render into the chart ConfigMap, so they aren't mounted whenconfigSecret.nameis set. Documented in values.yaml and the README; a Secret-provided pgdog.toml controls its own plugin config paths, so plugin files can be mounted viaextraVolumes.test/values-existing-config-secret.yamlplus assertions intest/test.shthat the volume source swaps, the key is remapped, and the ConfigMap is suppressed../test/test.shpasses.🤖 Generated with Claude Code