zalando / zalando/postgres-operator
Automated user/role removal feature for postgresql CR
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 5.2k
- Forks
- 1.1k
- Avg merge
- 2d 16h
- Merged PRs (30d)
- 3
Description
Please, answer some short questions which should help us to understand your problem / question better?
- Which image of the operator are you using?
registry.opensource.zalan.do/acid/postgres-operator:v1.8.2 - Where do you run it - cloud or metal? Kubernetes or OpenShift? [AWS K8s | GCP ... | Bare Metal K8s]
Bare Metal K8s - Are you running Postgres Operator in production? [yes | no]
no - Type of issue? [Bug report, question, feature request, etc.]
question, feature request
Hello,
Overview:
-
In
PostgresTeamsfeature there is an option to enableenable_team_member_deprecationwhich will mark deleted users/roles with appended prefix. Those users can be fetched and deleted via custom script. Users don't have generated passwords and should useOAuth2token in order to access database. -
In
postgresqlCR users/roles are added and have generated password in secret{namespace}.{username}.{clustername}.credentials.postgresql.acid.zalan.dobut removal feature for the users/roles seems to be missing.
Questions:
-
Is
PostgresTeamsCR andpostgresqlCR somehow related and user/role removal feature can be used forpostgresqlCR in similar way? -
Is there currently any other way how to automatically remove user/role from database when user is removed from
postgresqlCR as well without the usage of any custom scripts?
In documentation there is mentioned:
- The Postgres Operator does not delete database roles when users are removed from manifests.
(I'm really just trying my luck here.)
Requested Feature:
Give as an option/enabler to automatically delete users/roles from database when they are removed from postgresql CR without usage of any additional custom scripts:
- Check between removed users in
postgresqlCR and database will be scheduled based onresync_periodvariable. - When users/roles are removed from
postgresqlCR the same roles/users willDROPin database. - The secret located in
{namespace}.{username}.{clustername}.credentials.postgresql.acid.zalan.dowill be removed safely with the role/user itself. - User removal should be supported for user sync operations (spec pkg)
Thank you.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the user sync operations in the spec package and the resync_period behavior mentioned in the request; compare how the postgresql CR and PostgresTeams feature handle removed roles. Done means removed CR users and their credentials secrets are safely deleted from the database on the configured schedule without custom scripts.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, kubernetes, postgresql
- Domain
- databases, devops
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100