{"id":13562437,"url":"https://github.com/EasyMile/postgresql-operator","last_synced_at":"2025-04-03T18:33:41.197Z","repository":{"id":46591075,"uuid":"239769772","full_name":"EasyMile/postgresql-operator","owner":"EasyMile","description":"PostgreSQL Operator to create Databases and Users across multiple engines","archived":false,"fork":false,"pushed_at":"2024-04-10T18:58:04.000Z","size":5305,"stargazers_count":15,"open_issues_count":2,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-14T07:22:43.870Z","etag":null,"topics":["database","kubernetes-operator","postgresql","user-management"],"latest_commit_sha":null,"homepage":"https://easymile.github.io/postgresql-operator/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/EasyMile.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2020-02-11T13:34:34.000Z","updated_at":"2024-04-15T10:46:13.867Z","dependencies_parsed_at":"2024-01-16T18:59:38.895Z","dependency_job_id":"4ac8dbfb-6c23-4dee-94d2-5aa4d5509dd1","html_url":"https://github.com/EasyMile/postgresql-operator","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EasyMile%2Fpostgresql-operator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EasyMile%2Fpostgresql-operator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EasyMile%2Fpostgresql-operator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EasyMile%2Fpostgresql-operator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EasyMile","download_url":"https://codeload.github.com/EasyMile/postgresql-operator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247057072,"owners_count":20876508,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["database","kubernetes-operator","postgresql","user-management"],"created_at":"2024-08-01T13:01:08.576Z","updated_at":"2025-04-03T18:33:36.187Z","avatar_url":"https://github.com/EasyMile.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003ePostgreSQL Operator\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"http://godoc.org/github.com/easymile/postgresql-operator\" rel=\"noopener noreferer\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/godoc-reference-blue.svg\" alt=\"Go Doc\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/easymile/postgresql-operator/actions/workflows/ci.yml\" rel=\"noopener noreferer\" target=\"_blank\"\u003e\u003cimg src=\"https://github.com/easymile/postgresql-operator/actions/workflows/ci.yml/badge.svg\" alt=\"Github Actions\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://goreportcard.com/report/github.com/easymile/postgresql-operator\" rel=\"noopener noreferer\" target=\"_blank\"\u003e\u003cimg src=\"https://goreportcard.com/badge/github.com/easymile/postgresql-operator\" alt=\"Go Report Card\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://hub.docker.com/r/easymile/postgresql-operator\" rel=\"noopener noreferer\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/docker/pulls/easymile/postgresql-operator.svg\" alt=\"Docker Pulls\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/easymile/postgresql-operator/blob/master/LICENSE\" rel=\"noopener noreferer\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/github/license/easymile/postgresql-operator\" alt=\"GitHub license\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/easymile/postgresql-operator/releases\" rel=\"noopener noreferer\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/github/v/release/easymile/postgresql-operator\" alt=\"GitHub release (latest by date)\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n## Features\n\n- Create or update Databases with extensions and schemas\n- Create or update Users with rights (Owner, Writer or Reader)\n- Connections to multiple PostgreSQL Engines\n- Generate secrets for User login and password\n- Allow to change User password based on time (e.g: Each 30 days)\n\n## Concepts\n\nWhen we speak about `Engines`, we speak about PostgreSQL Database Servers. It isn't the same as Databases. Databases will store tables, ...\n\nIn this operator, Users are linked to Databases and doesn't exist without it. They are \"children\" of databases.\n\nMoreover, a single User can only have rights to one Database.\n\n## Supported Custom Resources\n\n| CustomResourceDefinition                                                    | Description                                                                        |\n| --------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- |\n| [PostgresqlEngineConfiguration](docs/crds/PostgresqlEngineConfiguration.md) | Represents a PostgreSQL Engine Configuration with all necessary data to connect it |\n| [PostgresqlDatabase](docs/crds/PostgresqlDatabase.md)                       | Represents a PostgreSQL Database                                                   |\n| [PostgresqlUserRole](docs/crds/PostgresqlUserRole.md)                       | Represents a PostgreSQL User Role                                                  |\n\n## How to deploy ?\n\n### Using Helm\n\n#### From EasyMile Helm Chart Repository\n\n```bash\nhelm repo add easymile https://easymile.github.io/helm-charts/\n```\n\nAnd then deploy:\n\n```bash\nhelm install postgresql-operator easymile/postgresql-operator\n```\n\n#### From Git\n\nThe project has a Helm 3 chart located in `deploy/helm/postgresql-operator`.\n\nIt will deploy the operator running the command:\n\n```bash\nhelm install postgresql-operator ./helm/postgresql-operator\n```\n\n## Getting Started\n\nYou’ll need a Kubernetes cluster to run against. You can use [KIND](https://sigs.k8s.io/kind) to get a local cluster for testing, or run against a remote cluster.\n**Note:** Your controller will automatically use the current context in your kubeconfig file (i.e. whatever cluster `kubectl cluster-info` shows).\n\nRead how to setup your environment [here](./docs/how-to/setup-local.md)\n\n### Running on the cluster\n\n1. Install Instances of Custom Resources:\n\n```sh\nkubectl apply -f config/samples/\n```\n\n2. Build and push your image to the location specified by `IMG`:\n\n```sh\nmake docker-build docker-push IMG=\u003csome-registry\u003e/postgresql-operator:tag\n```\n\n3. Deploy the controller to the cluster with the image specified by `IMG`:\n\n```sh\nmake deploy IMG=\u003csome-registry\u003e/postgresql-operator:tag\n```\n\n### Uninstall CRDs\n\nTo delete the CRDs from the cluster:\n\n```sh\nmake uninstall\n```\n\n### Undeploy controller\n\nUnDeploy the controller to the cluster:\n\n```sh\nmake undeploy\n```\n\n## Contributing\n\nRead the [CONTRIBUTING guide](./CONTRIBUTING.md)\n\n### How it works\n\nThis project aims to follow the Kubernetes [Operator pattern](https://kubernetes.io/docs/concepts/extend-kubernetes/operator/)\n\nIt uses [Controllers](https://kubernetes.io/docs/concepts/architecture/controller/)\nwhich provides a reconcile function responsible for synchronizing resources untile the desired state is reached on the cluster\n\n### Test It Out\n\n1. Install the CRDs into the cluster:\n\n```sh\nmake install\n```\n\n2. Run your controller (this will run in the foreground, so switch to a new terminal if you want to leave it running):\n\n```sh\nmake run\n```\n\n**NOTE:** You can also run this in one step by running: `make install run`\n\n### Modifying the API definitions\n\nIf you are editing the API definitions, generate the manifests such as CRs or CRDs using:\n\n```sh\nmake manifests\n```\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 2022.\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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FEasyMile%2Fpostgresql-operator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FEasyMile%2Fpostgresql-operator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FEasyMile%2Fpostgresql-operator/lists"}