diff --git a/charts/postgrescluster/Chart.yaml b/charts/postgrescluster/Chart.yaml index 746b604..fc836eb 100644 --- a/charts/postgrescluster/Chart.yaml +++ b/charts/postgrescluster/Chart.yaml @@ -3,5 +3,5 @@ name: postgrescluster description: A Helm chart for deploying a PostgresCluster instance using Crunchy Postgres Operator. https://access.crunchydata.com/documentation/postgres-operator/latest type: application # The version below should match the version on the PostgresCluster CRD -version: 5.6.1 +version: 5.6.2 appVersion: 5.6.1 diff --git a/charts/postgrescluster/README.md b/charts/postgrescluster/README.md index 3e201dd..621d78e 100644 --- a/charts/postgrescluster/README.md +++ b/charts/postgrescluster/README.md @@ -35,8 +35,10 @@ If you haven't already installed the PGO chart in your cluster, you will need to helm install pgo -n pgo jshimko/pgo --set features.AutoCreateUserSchema=true ``` +Note that we are installing the PGO chart above with the `AutoCreateUserSchema` feature flag enabled ([more info](https://access.crunchydata.com/documentation/postgres-operator/latest/tutorials/basic-setup/user-management#automatically-creating-per-user-schemas)). This is recommended so you don't have to manually create a user schema and grant permissions for your application user. If you choose not to enable this, you will need to manually grant the necessary permissions for your application user to access the database. + To deploy a `PostgresCluster` instance: ```sh -helm install my-pg-cluster -n my-namespace -f my-values.yaml jshimko/postgrescluster +helm install my-pg-cluster -n my-namespace -f my-values.yaml jshimko/postgrescluster --set autoCreateUserSchema=true ``` diff --git a/charts/postgrescluster/templates/postgres.yaml b/charts/postgrescluster/templates/postgres.yaml index 81d0c6a..f13070c 100644 --- a/charts/postgrescluster/templates/postgres.yaml +++ b/charts/postgrescluster/templates/postgres.yaml @@ -4,8 +4,11 @@ apiVersion: postgres-operator.crunchydata.com/v1beta1 kind: PostgresCluster metadata: name: {{ default .Release.Name .Values.name }} - {{ with .Values.annotations }} annotations: + {{ if .Values.autoCreateUserSchema }} + postgres-operator.crunchydata.com/autoCreateUserSchema: "true" + {{ end }} + {{ with .Values.annotations }} {{ toYaml . | indent 4 }} {{ end }} spec: diff --git a/charts/postgrescluster/values.yaml b/charts/postgrescluster/values.yaml index a62a503..613a886 100644 --- a/charts/postgrescluster/values.yaml +++ b/charts/postgrescluster/values.yaml @@ -13,7 +13,7 @@ # PostgresCluster annotations # annotations: -# postgres-operator.crunchydata.com/autoCreateUserSchema: "true" +# postgres-operator.crunchydata.com/someFeature: "true" # postgresVersion sets the version to deploy. This version number needs to be # available as one of the "RELATED_IMAGE_POSTGRES_..." images as part of the PGO @@ -143,6 +143,10 @@ postgresVersion: 16 # as well as any permissions associated with the user account. # https://access.crunchydata.com/documentation/postgres-operator/latest/references/crd/5.6.x/postgrescluster#postgresclusterspecusersindex # users: {} +# +# optionally create a user schema and grant permissions for the application user on their configured databases. +# https://access.crunchydata.com/documentation/postgres-operator/latest/tutorials/basic-setup/user-management#automatically-creating-per-user-schemas +# autoCreateUserSchema: true # dataSource specifies a data source for bootstrapping a Postgres cluster. # https://access.crunchydata.com/documentation/postgres-operator/latest/references/crd/5.6.x/postgrescluster#postgresclusterspecdatasource