diff --git a/docs/examples/pgbouncer/sync-users/pgbouncer-sync.yaml b/docs/examples/pgbouncer/sync-users/pgbouncer-sync.yaml new file mode 100644 index 0000000000..8aae37078b --- /dev/null +++ b/docs/examples/pgbouncer/sync-users/pgbouncer-sync.yaml @@ -0,0 +1,15 @@ +apiVersion: kubedb.com/v1 +kind: PgBouncer +metadata: + name: pgbouncer-sync + namespace: demo +spec: + version: "1.23.1" + replicas: 1 + database: + syncUsers: true + databaseName: "postgres" + databaseRef: + name: "ha-postgres" + namespace: demo + deletionPolicy: WipeOut \ No newline at end of file diff --git a/docs/examples/pgbouncer/sync-users/secret.yaml b/docs/examples/pgbouncer/sync-users/secret.yaml new file mode 100644 index 0000000000..f4b0e86148 --- /dev/null +++ b/docs/examples/pgbouncer/sync-users/secret.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Secret +metadata: + labels: + app.kubernetes.io/instance: ha-postgres + app.kubernetes.io/name: postgreses.kubedb.com + name: sync-secret + namespace: demo +stringData: + password: "12345" + username: "john" \ No newline at end of file diff --git a/docs/guides/pgbouncer/README.md b/docs/guides/pgbouncer/README.md index c3ed534ed4..b64cf5f4bb 100644 --- a/docs/guides/pgbouncer/README.md +++ b/docs/guides/pgbouncer/README.md @@ -23,14 +23,21 @@ KubeDB operator now comes bundled with PgBouncer crd to handle connection poolin ## PgBouncer Features -| Features | Availability | -|------------------------------------|:------------:| -| Clustering | ✓ | -| Multiple PgBouncer Versions | ✓ | -| Customizable Pooling Configuration | ✓ | -| Custom docker images | ✓ | -| Builtin Prometheus Discovery | ✓ | -| Using Prometheus operator | ✓ | +| Features | Availability | +|-------------------------------------------------------------| :----------: | +| Multiple PgBouncer Versions | ✓ | +| Custom Configuration | ✓ | +| Externally manageable Auth Secret | ✓ | +| Reconfigurable Health Checker | ✓ | +| Integrate with externally managed PostgreSQL | ✓ | +| Sync Postgres Users to PgBouncer | ✓ | +| Custom docker images | ✓ | +| TLS: Add ( [Cert Manager]((https://cert-manager.io/docs/))) | ✓ | +| Monitoring with Prometheus & Grafana | ✓ | +| Builtin Prometheus Discovery | ✓ | +| Using Prometheus operator | ✓ | +| Alert Dashboard | ✓ | +| Grafana Dashboard | ✓ | ## User Guide diff --git a/docs/guides/pgbouncer/concepts/appbinding.md b/docs/guides/pgbouncer/concepts/appbinding.md index 1e1fdb8c49..170a60250f 100644 --- a/docs/guides/pgbouncer/concepts/appbinding.md +++ b/docs/guides/pgbouncer/concepts/appbinding.md @@ -20,8 +20,6 @@ An `AppBinding` is a Kubernetes `CustomResourceDefinition`(CRD) which points to If you deploy a database using [KubeDB](https://kubedb.com/docs/latest/welcome/), `AppBinding` object will be created automatically for it. Otherwise, you have to create an `AppBinding` object manually pointing to your desired database. -KubeDB uses [Stash](https://appscode.com/products/stash/) to perform backup/recovery of databases. Stash needs to know how to connect with a target database and the credentials necessary to access it. This is done via an `AppBinding`. - ## AppBinding CRD Specification Like any official Kubernetes resource, an `AppBinding` has `TypeMeta`, `ObjectMeta` and `Spec` sections. However, unlike other Kubernetes resources, it does not have a `Status` section. @@ -71,7 +69,7 @@ An `AppBinding` object has the following fields in the `spec` section: #### spec.type -`spec.type` is an optional field that indicates the type of the app that this `AppBinding` is pointing to. Stash uses this field to resolve the values of `TARGET_APP_TYPE`, `TARGET_APP_GROUP` and `TARGET_APP_RESOURCE` variables of [BackupBlueprint](https://appscode.com/products/stash/latest/concepts/crds/backupblueprint/) object. +`spec.type` is an optional field that indicates the type of the app that this `AppBinding` is pointing to. PgBouncer operator uses this field to recognise the desired postgres database. This field follows the following format: `/`. The above AppBinding is pointing to a `postgres` resource under `kubedb.com` group. diff --git a/docs/guides/pgbouncer/concepts/pgbouncer.md b/docs/guides/pgbouncer/concepts/pgbouncer.md index f343a68e6c..4ae8a0f721 100644 --- a/docs/guides/pgbouncer/concepts/pgbouncer.md +++ b/docs/guides/pgbouncer/concepts/pgbouncer.md @@ -32,7 +32,7 @@ metadata: namespace: demo spec: version: "1.18.0" - replicas: 2 + replicas: 1 database: syncUsers: true databaseName: "postgres" diff --git a/docs/guides/pgbouncer/custom-versions/setup.md b/docs/guides/pgbouncer/custom-versions/setup.md index 737b2684d3..3519ea56e1 100644 --- a/docs/guides/pgbouncer/custom-versions/setup.md +++ b/docs/guides/pgbouncer/custom-versions/setup.md @@ -21,7 +21,7 @@ PgBouncerVersions are KubeDB crds that define the docker images KubeDB will use If you want to create a custom image of pgbouncer with additional features, the best way is to build on top of the existing kubedb image. ```docker -FROM kubedb/pgbouncer:1.17.0 +FROM kubedb/pgbouncer:1.23.1 ENV SOME_VERSION_VAR 0.9.1 @@ -32,18 +32,18 @@ RUN set -ex \ bash ``` -From there, we would define a PgBouncerVersion that contains this new image. Let's say we tagged it as `myco/pgbouncer:custom-1.17.0`. You can also build exporter image yourself using [pgbouncer_exporter](https://github.com/kubedb/pgbouncer_exporter) repository. +From there, we would define a PgBouncerVersion that contains this new image. Let's say we tagged it as `myco/pgbouncer:custom-1.23.1`. You can also build exporter image yourself using [pgbouncer_exporter](https://github.com/kubedb/pgbouncer_exporter) repository. ```yaml apiVersion: catalog.kubedb.com/v1alpha1 kind: PgBouncerVersion metadata: - name: "1.17.0" + name: "1.23.1" spec: deprecated: false - version: "1.17.0" + version: "1.23.1" pgBouncer: - image: "myco/pgbouncer:custom-1.17.0" + image: "myco/pgbouncer:custom-1.23.1" exporter: image: "myco/pgbouncer_exporter:v0.1.1" ``` @@ -57,7 +57,7 @@ metadata: name: pgbouncer-server namespace: demo spec: - version: "1.17.0" + version: "1.23.1" replicas: 1 connectionPool: poolMode: session diff --git a/docs/guides/pgbouncer/quickstart/quickstart.md b/docs/guides/pgbouncer/quickstart/quickstart.md index 8cdbceb6e8..5b5dcfcc70 100644 --- a/docs/guides/pgbouncer/quickstart/quickstart.md +++ b/docs/guides/pgbouncer/quickstart/quickstart.md @@ -47,6 +47,7 @@ $ kubectl get pgbouncerversions NAME VERSION PGBOUNCER_IMAGE DEPRECATED AGE 1.17.0 1.17.0 ghcr.io/kubedb/pgbouncer:1.17.0 22h 1.18.0 1.18.0 ghcr.io/kubedb/pgbouncer:1.18.0 22h + 1.23.1 1.23.1 ghcr.io/kubedb/pgbouncer:1.23.1 22h ``` @@ -258,9 +259,8 @@ Following table show what KubeDB does when you delete Postgres crd for different | Behavior | DoNotTerminate | Delete | WipeOut | |---------------------------| :------------: | :------: | :------: | | 1. Block Delete operation | ✓ | ✗ | ✗ | -| 2. Delete PetSet | ✗ | ✓ | ✓ | +| 2. Delete PetSet | ✗ | ✓ | ✓ | | 3. Delete Services | ✗ | ✓ | ✓ | -| 4. Delete PVCs | ✗ | ✓ | ✓ | | 5. Delete Secrets | ✗ | ✗ | ✓ | diff --git a/docs/guides/pgbouncer/sync-users/sync-users-pgbouncer.md b/docs/guides/pgbouncer/sync-users/sync-users-pgbouncer.md index 77cb730269..8184e0bc8a 100644 --- a/docs/guides/pgbouncer/sync-users/sync-users-pgbouncer.md +++ b/docs/guides/pgbouncer/sync-users/sync-users-pgbouncer.md @@ -100,8 +100,8 @@ Now, wait until `pgbouncer-sync` has status `Ready`. i.e, ```bash $ kubectl get pb -n demo -NAME TYPE VERSION STATUS AGE -pgbouncer-sync kubedb.com/v1 1.18.0 Ready 41s +NAME TYPE VERSION STATUS AGE +pgbouncer-sync kubedb.com/v1 1.18.0 Ready 41s ``` ### Sync Users