Skip to content

Add envFrom support to Postgresql spec#3118

Open
annielzy wants to merge 2 commits into
zalando:masterfrom
annielzy:annieli/envFrom
Open

Add envFrom support to Postgresql spec#3118
annielzy wants to merge 2 commits into
zalando:masterfrom
annielzy:annieli/envFrom

Conversation

@annielzy

Copy link
Copy Markdown
Contributor

Adds top-level spec.envFrom support for Postgresql resources, allowing the Spilo container to populate environment variables from ConfigMaps and Secrets using standard Kubernetes EnvFromSource entries.

Changes:

  • Add EnvFrom []v1.EnvFromSource to PostgresSpec.
  • Pass spec.envFrom into the generated Postgres container.
  • Update deepcopy and PostgreSQL CRD schemas.
  • Add tests covering StatefulSet updates and container generation with envFrom.

@annielzy annielzy marked this pull request as draft June 25, 2026 19:40
@annielzy annielzy marked this pull request as ready for review June 25, 2026 21:22
@FxKu

FxKu commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Thanks @annielzy. Have you tried using the global pod_environment_configmap or pod_environment_secretoptions? Or do you really need to mount extra secrets / configmap locally per database resource?

@FxKu FxKu added the minor label Jun 26, 2026
@annielzy

Copy link
Copy Markdown
Contributor Author

Thanks @annielzy. Have you tried using the global pod_environment_configmap or pod_environment_secretoptions? Or do you really need to mount extra secrets / configmap locally per database resource?

Hi @FxKu, yes, we use the global pod_environment_configmap option to reference a ConfigMap at the operator level.
For this use case, we need to additionally reference a workload-specific ConfigMap with a generated name that provides the SDK environment variables for mounted cloud credentials or OIDC token paths. Since pod_environment_configmap can only point to one ConfigMap per operator configuration, it does not cover this case without merging unrelated configuration. envFrom lets us add that workload-specific reference directly on the database resource that needs it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants