Skip to content

Operator fails to create secret in separate namespace when using ownerReferences and preparedDatabases #2910

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
mortenlj opened this issue May 16, 2025 · 1 comment · May be fixed by #2912

Comments

@mortenlj
Copy link

Please, answer some short questions which should help us to understand your problem / question better?

  • Which image of the operator are you using? e.g. ghcr.io/zalando/postgres-operator:v1.13.0
    ghcr.io/zalando/postgres-operator:v1.14.0
  • Where do you run it - cloud or metal? Kubernetes or OpenShift? [AWS K8s | GCP ... | Bare Metal K8s]
    GCP
  • Are you running Postgres Operator in production? [yes | no]
    Not yet, currently setting up for initial deployment
  • Type of issue? [Bug report, question, feature request, etc.]
    Bug report

Some general remarks when posting a bug report:

  • Please, check the operator, pod (Patroni) and postgresql logs first. When copy-pasting many log lines please do it in a separate GitHub gist together with your Postgres CRD and configuration manifest.
  • If you feel this issue might be more related to the Spilo docker image or Patroni, consider opening issues in the respective repos.

When enabling ownerReferences, and using preparedDatabases in the cluster definition with defaultUsers: true, the operator fails to create the secrets because it attempts to attach a cross-namespace ownerReference.

The problem seems to be that this check doesn't account for the fact that when using preparedDatabases you can set secretNamespace to a value that differs from the namespace the cluster is defined in.

We realize we can create users via users instead of relying on the default users, but this still seems to be a bug that should be addressed.

@mortenlj
Copy link
Author

This might be a duplicate of #2873 , didn't find that one in my initial search.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant