{"id":26533649,"url":"https://github.com/rgeraskin/psql-roles-operator","last_synced_at":"2026-04-15T05:31:28.021Z","repository":{"id":283215758,"uuid":"951049128","full_name":"rgeraskin/psql-roles-operator","owner":"rgeraskin","description":"Kubernetes Operator that manages PostgreSQL roles and users","archived":false,"fork":false,"pushed_at":"2025-03-19T05:07:51.000Z","size":81,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-14T21:33:57.542Z","etag":null,"topics":["go","golang","k8s","kubernetes","kubernetes-operator","operator-sdk","postgres","postgresql"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rgeraskin.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-19T04:55:37.000Z","updated_at":"2025-03-19T05:07:41.000Z","dependencies_parsed_at":"2025-03-19T12:31:12.772Z","dependency_job_id":null,"html_url":"https://github.com/rgeraskin/psql-roles-operator","commit_stats":null,"previous_names":["rgeraskin/psql-roles-operator"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/rgeraskin/psql-roles-operator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgeraskin%2Fpsql-roles-operator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgeraskin%2Fpsql-roles-operator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgeraskin%2Fpsql-roles-operator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgeraskin%2Fpsql-roles-operator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rgeraskin","download_url":"https://codeload.github.com/rgeraskin/psql-roles-operator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgeraskin%2Fpsql-roles-operator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31828530,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T18:05:02.291Z","status":"online","status_checked_at":"2026-04-15T02:00:06.175Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go","golang","k8s","kubernetes","kubernetes-operator","operator-sdk","postgres","postgresql"],"created_at":"2025-03-21T19:19:17.528Z","updated_at":"2026-04-15T05:31:28.004Z","avatar_url":"https://github.com/rgeraskin.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PSQL Roles Operator\n\nKubernetes Operator that manages PostgreSQL roles and users.\n\n## Description\n\nPostgreSQL Roles Operator can:\n\n1. Create roles with optional description, login, replication.\n1. Drop roles if they dissapear from the Roles custom resource.\n1. Reconcile roles spec.\n1. Reconcile role grants, memberships.\n1. Reconcile additional users with login=true that belong to the role.\n\nMore to come!\n\n**Note:** This operator is not production ready yet. It is under active development.\n\n## Usage\n\n1. Install operator\n   ```bash\n   kubectl apply -f https://raw.githubusercontent.com/rgeraskin/psql-roles-operator/v0.0.1/dist/install.yaml\n   ```\n1. Create Roles custom resource\n   ```yaml\n   apiVersion: postgresql.rgeraskin.dev/v1alpha1\n   kind: Roles\n   metadata:\n     name: roles\n   spec:\n     database:\n       connection_string: postgres://postgres:password@localhost:15432/postgres?sslmode=disable\n     roles:\n       - name: test_role\n         description: test role # optional\n         login: true # optional, default false\n         replication: false # optional, default false\n         grants: # optional, default empty so removes all grants\n           - schema: public\n             object_type: table\n             objects:\n               - table1\n               - table2\n             privileges:\n               - insert\n               - SELECT\n         member_of: # optional, default empty\n           - parent_role1\n           - parent_role2\n         users: # optional, default empty. Creates users with login=true and memberOf=\u003cthis role\u003e\n           - user1\n           - user2\n    ```\n### Limitations\n\nWill be fixed in future releases:\n\n1. Roles password is not created by operator.\n1. Only object_type=table is supported for grants.\n1. CreateDatabase and CreateRole permissions are not supported.\n1. If role is an owner of some object, it will not be deleted.\n1. Weak schema validation.\n\n## Development\n\n### Prerequisites\n- go version v1.22.0+\n- docker version 17.03+.\n- kubectl version v1.11.3+.\n- Access to a Kubernetes v1.11.3+ cluster.\n\n### To Deploy on the cluster\n**Build and push your image to the location specified by `IMG`:**\n\n```sh\nmake docker-build docker-push IMG=\u003csome-registry\u003e/psql-roles-operator:tag\n```\n\n**NOTE:** This image ought to be published in the personal registry you specified.\nAnd it is required to have access to pull the image from the working environment.\nMake sure you have the proper permission to the registry if the above commands don’t work.\n\n**Install the CRDs into the cluster:**\n\n```sh\nmake install\n```\n\n**Deploy the Manager to the cluster with the image specified by `IMG`:**\n\n```sh\nmake deploy IMG=\u003csome-registry\u003e/psql-roles-operator:tag\n```\n\n\u003e **NOTE**: If you encounter RBAC errors, you may need to grant yourself cluster-admin\nprivileges or be logged in as admin.\n\n**Create instances of your solution**\nYou can apply the samples (examples) from the config/sample:\n\n```sh\nkubectl apply -k config/samples/\n```\n\n\u003e**NOTE**: Ensure that the samples has default values to test it out.\n\n### To Uninstall\n**Delete the instances (CRs) from the cluster:**\n\n```sh\nkubectl delete -k config/samples/\n```\n\n**Delete the APIs(CRDs) from the cluster:**\n\n```sh\nmake uninstall\n```\n\n**UnDeploy the controller from the cluster:**\n\n```sh\nmake undeploy\n```\n\n## Project Distribution\n\nFollowing are the steps to build the installer and distribute this project to users.\n\n1. Build the installer for the image built and published in the registry:\n\n```sh\nmake build-installer IMG=\u003csome-registry\u003e/psql-roles-operator:tag\n```\n\nNOTE: The makefile target mentioned above generates an 'install.yaml'\nfile in the dist directory. This file contains all the resources built\nwith Kustomize, which are necessary to install this project without\nits dependencies.\n\n2. Using the installer\n\nUsers can just run kubectl apply -f \u003cURL for YAML BUNDLE\u003e to install the project, i.e.:\n\n```sh\nkubectl apply -f https://raw.githubusercontent.com/\u003corg\u003e/psql-roles-operator/\u003ctag or branch\u003e/dist/install.yaml\n```\n\n## Contributing\n// TODO(user): Add detailed information on how you would like others to contribute to this project\n\n**NOTE:** Run `make help` for more information on all potential `make` targets\n\nMore information can be found via the [Kubebuilder Documentation](https://book.kubebuilder.io/introduction.html)\n\n## License\n\nCopyright 2025.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frgeraskin%2Fpsql-roles-operator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frgeraskin%2Fpsql-roles-operator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frgeraskin%2Fpsql-roles-operator/lists"}