Sign inSign up

easymile/postgresql-operator

By easymile

•Updated over 1 year ago

Operator for database and user management inside PostgreSQL engine

Image
0

10K+

easymile/postgresql-operator repository overview

⁠PostgreSQL Operator

Go Doc Travis CI Go Report Card Docker Pulls GitHub license GitHub release (latest by date)

⁠Github Repository

https://github.com/EasyMile/postgresql-operator⁠

⁠Features

  • Create or update Databases with extensions and schemas
  • Create or update Users with rights (Owner, Writer or Reader)
  • Connections to multiple PostgreSQL Engines
  • Generate secrets for User login and password
  • Allow to change User password based on time (e.g: Each 30 days)

⁠Concepts

When we speak about Engines, we speak about PostgreSQL Database Servers. It isn't the same as Databases. Databases will store tables, ...

In this operator, Users are linked to Databases and doesn't exist without it. They are "children" of databases.

Moreover, a single User can only have rights to one Database.

⁠Supported Custom Resources

CustomResourceDefinitionDescription
PostgresqlEngineConfiguration⁠Represents a PostgreSQL Engine Configuration with all necessary data to connect it
PostgresqlDatabase⁠Represents a PostgreSQL Database
PostgresqlUser⁠Represents a PostgreSQL User

⁠How to deploy ?

⁠Using Helm 3

The project has a Helm 3 chart located in deploy/helm/postgresql-operator.

It will deploy the operator running the command:

helm install postgresql-operator ./deploy/helm/postgresql-operator
⁠Using Helm 2

As the chart located in deploy/helm/postgresql-operator uses the specific Helm 3 folder called crd. The chart can only install the operator but not the CRDs.

CRDs have to be installed manually.

The procedure is the following:

  • Install CRDs
    kubectl apply -f ./deploy/crds/
    
  • Install the chart
    helm install postgresql-operator ./deploy/helm/postgresql-operator
    
⁠Using Kubectl

The procedure is the following:

  • Install CRDs
    kubectl apply -f ./deploy/crds/
    
  • Install operator
    kubectl apply -f ./deploy/role_binding.yaml
    kubectl apply -f ./deploy/role.yaml
    kubectl apply -f ./deploy/service_account.yaml
    kubectl apply -f ./deploy/operator.yaml
    

⁠Want to contribute ?

⁠License

MIT (See LICENSE⁠)

Tag summary

Content type

Image

Digest

Size

54.9 MB

Last updated

over 5 years ago

docker pull easymile/postgresql-operator