Skip to content

Add envFrom support to Postgresql spec#3118

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

Add envFrom support to Postgresql spec#3118
annielzy wants to merge 3 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.

@FxKu

FxKu commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

@annielzy can you rebase? I think then we can merge it.

@FxKu FxKu added this to the 2.0.0 milestone Jul 14, 2026
@FxKu FxKu moved this to Open Questions in Postgres Operator Jul 14, 2026
@FxKu
FxKu requested a review from idanovinda as a code owner July 17, 2026 10:08
@FxKu

FxKu commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

I resolved the conflicts. We have to provide a paragraph at the end of this admin doc chapter.

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

Labels

Projects

Status: Open Questions

Development

Successfully merging this pull request may close these issues.

2 participants