Skip to content

Commit

Permalink
Add Complete PgBouncer Docs (#718)
Browse files Browse the repository at this point in the history
* Signed-off-by: Hiranmoy Das Chowdhury <[email protected]>

* update-version
Signed-off-by: Hiranmoy Das Chowdhury <[email protected]>

* scaling done
Signed-off-by: Hiranmoy Das Chowdhury <[email protected]>

* autoScaler
Signed-off-by: Hiranmoy Das Chowdhury <[email protected]>

* reconfiguration
Signed-off-by: Hiranmoy Das Chowdhury <[email protected]>

* restart
Signed-off-by: Hiranmoy Das Chowdhury <[email protected]>

* monitoring
Signed-off-by: Hiranmoy Das Chowdhury <[email protected]>

* Signed-off-by: Hiranmoy Das Chowdhury <[email protected]>

* all completed until custom version
Signed-off-by: Hiranmoy Das Chowdhury <[email protected]>

* update version svg
Signed-off-by: Hiranmoy Das Chowdhury <[email protected]>

* completed till update-version

Signed-off-by: Hiranmoy Das Chowdhury <[email protected]>

* Horizontal scaling done
Signed-off-by: Hiranmoy Das Chowdhury <[email protected]>

* vertical scaling done fully
Signed-off-by: Hiranmoy Das Chowdhury <[email protected]>

* autoscaling all done
Signed-off-by: Hiranmoy Das Chowdhury <[email protected]>

* all done for reconfiguration
Signed-off-by: Hiranmoy Das Chowdhury <[email protected]>

* restart done
Signed-off-by: Hiranmoy Das Chowdhury <[email protected]>

* duplication removed
Signed-off-by: Hiranmoy Das Chowdhury <[email protected]>

* build fixed
Signed-off-by: Hiranmoy Das Chowdhury <[email protected]>

* remove reconfigure tls
Signed-off-by: Hiranmoy Das Chowdhury <[email protected]>

* image added for monitoring
Signed-off-by: Hiranmoy Das Chowdhury <[email protected]>

* pgbouncer wiki change
Signed-off-by: Hiranmoy Das Chowdhury <[email protected]>

* autoscaling issue fixed
Signed-off-by: Hiranmoy Das Chowdhury <[email protected]>

* test
Signed-off-by: Hiranmoy Das Chowdhury <[email protected]>

* test 2
Signed-off-by: Hiranmoy Das Chowdhury <[email protected]>

* test 3
Signed-off-by: Hiranmoy Das Chowdhury <[email protected]>

* update version camel case removed
Signed-off-by: Hiranmoy Das Chowdhury <[email protected]>

* monitoring part is done
Signed-off-by: Hiranmoy Das Chowdhury <[email protected]>

* image changes for monitoring
Signed-off-by: Hiranmoy Das Chowdhury <[email protected]>

* camecase solved
Signed-off-by: Hiranmoy Das Chowdhury <[email protected]>

---------

Signed-off-by: Hiranmoy Das Chowdhury <[email protected]>
  • Loading branch information
HiranmoyChowdhury authored Dec 13, 2024
1 parent 0440c8f commit 6d67a6e
Show file tree
Hide file tree
Showing 56 changed files with 3,850 additions and 348 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: kubedb.com/v1
kind: PgBouncer
metadata:
name: pgbouncer-autoscale
namespace: demo
spec:
replicas: 1
version: "1.18.0"
database:
syncUsers: true
databaseName: "postgres"
databaseRef:
name: "ha-postgres"
namespace: demo
connectionPool:
poolMode: session
port: 5432
reservePoolSize: 5
maxClientConnections: 87
defaultPoolSize: 2
minPoolSize: 1
authType: md5
deletionPolicy: WipeOut
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: autoscaling.kubedb.com/v1alpha1
kind: PgBouncerAutoscaler
metadata:
name: pgbouncer-autoscale-ops
namespace: demo
spec:
databaseRef:
name: pgbouncer-autoscale
compute:
pgbouncer:
trigger: "On"
podLifeTimeThreshold: 5m
resourceDiffPercentage: 20
minAllowed:
cpu: 400m
memory: 400Mi
maxAllowed:
cpu: 1
memory: 1Gi
controlledResources: ["cpu", "memory"]
containerControlledValues: "RequestsAndLimits"
22 changes: 22 additions & 0 deletions docs/examples/pgbouncer/reconfigure/pb-custom-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: kubedb.com/v1
kind: PgBouncer
metadata:
name: pb-custom
namespace: demo
spec:
replicas: 1
version: "1.18.0"
database:
syncUsers: true
databaseName: "postgres"
databaseRef:
name: "ha-postgres"
namespace: demo
connectionPool:
poolMode: session
port: 5432
reservePoolSize: 5
maxClientConnections: 87
defaultPoolSize: 2
minPoolSize: 1
deletionPolicy: WipeOut
17 changes: 17 additions & 0 deletions docs/examples/pgbouncer/reconfigure/pbops-reconfigure-apply.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: ops.kubedb.com/v1alpha1
kind: PgBouncerOpsRequest
metadata:
name: pbops-reconfigure-apply
namespace: demo
spec:
type: Reconfigure
databaseRef:
name: pb-custom
configuration:
pgbouncer:
applyConfig:
pgbouncer.ini: |-
[pgbouncer]
auth_type=scram-sha-256
timeout: 5m
apply: IfReady
15 changes: 15 additions & 0 deletions docs/examples/pgbouncer/reconfigure/pbops-reconfigure.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: ops.kubedb.com/v1alpha1
kind: PgBouncerOpsRequest
metadata:
name: pbops-reconfigure
namespace: demo
spec:
type: Reconfigure
databaseRef:
name: pb-custom
configuration:
pgbouncer:
configSecret:
name: new-custom-config
timeout: 5m
apply: IfReady
11 changes: 11 additions & 0 deletions docs/examples/pgbouncer/restart/ops.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: ops.kubedb.com/v1alpha1
kind: PgBouncerOpsRequest
metadata:
name: restart-pgbouncer
namespace: demo
spec:
type: Restart
databaseRef:
name: pgbouncer
timeout: 3m
apply: Always
23 changes: 23 additions & 0 deletions docs/examples/pgbouncer/restart/pgbouncer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: kubedb.com/v1
kind: PgBouncer
metadata:
name: pgbouncer
namespace: demo
spec:
replicas: 1
version: "1.18.0"
database:
syncUsers: true
databaseName: "postgres"
databaseRef:
name: "ha-postgres"
namespace: demo
connectionPool:
poolMode: session
port: 5432
reservePoolSize: 5
maxClientConnections: 87
defaultPoolSize: 2
minPoolSize: 1
authType: md5
deletionPolicy: WipeOut
11 changes: 11 additions & 0 deletions docs/examples/pgbouncer/scaling/horizontal-scaling-down-ops.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: ops.kubedb.com/v1alpha1
kind: PgBouncerOpsRequest
metadata:
name: pgbouncer-horizontal-scale-down
namespace: demo
spec:
type: HorizontalScaling
databaseRef:
name: pb-horizontal
horizontalScaling:
replicas: 2
11 changes: 11 additions & 0 deletions docs/examples/pgbouncer/scaling/horizontal-scaling-ops.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: ops.kubedb.com/v1alpha1
kind: PgBouncerOpsRequest
metadata:
name: pgbouncer-horizontal-scale-up
namespace: demo
spec:
type: HorizontalScaling
databaseRef:
name: pb-horizontal
horizontalScaling:
replicas: 3
23 changes: 23 additions & 0 deletions docs/examples/pgbouncer/scaling/pb-horizontal.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: kubedb.com/v1
kind: PgBouncer
metadata:
name: pb-horizontal
namespace: demo
spec:
replicas: 1
version: "1.18.0"
database:
syncUsers: true
databaseName: "postgres"
databaseRef:
name: "ha-postgres"
namespace: demo
connectionPool:
poolMode: session
port: 5432
reservePoolSize: 5
maxClientConnections: 87
defaultPoolSize: 2
minPoolSize: 1
authType: md5
deletionPolicy: WipeOut
20 changes: 20 additions & 0 deletions docs/examples/pgbouncer/scaling/pb-vertical-ops.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: ops.kubedb.com/v1alpha1
kind: PgBouncerOpsRequest
metadata:
name: pgbouncer-scale-vertical
namespace: demo
spec:
type: VerticalScaling
databaseRef:
name: pb-vertical
verticalScaling:
pgbouncer:
resources:
requests:
memory: "2Gi"
cpu: "1"
limits:
memory: "2Gi"
cpu: "1"
timeout: 5m
apply: IfReady
23 changes: 23 additions & 0 deletions docs/examples/pgbouncer/scaling/pb-vertical.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: kubedb.com/v1
kind: PgBouncer
metadata:
name: pb-vertical
namespace: demo
spec:
replicas: 1
version: "1.18.0"
database:
syncUsers: true
databaseName: "postgres"
databaseRef:
name: "ha-postgres"
namespace: demo
connectionPool:
poolMode: session
port: 5432
reservePoolSize: 5
maxClientConnections: 87
defaultPoolSize: 2
minPoolSize: 1
authType: md5
deletionPolicy: WipeOut
15 changes: 15 additions & 0 deletions docs/examples/pgbouncer/sync-users/pgbouncer-sync.yaml
Original file line number Diff line number Diff line change
@@ -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
11 changes: 11 additions & 0 deletions docs/examples/pgbouncer/sync-users/secret.yaml
Original file line number Diff line number Diff line change
@@ -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"
23 changes: 23 additions & 0 deletions docs/examples/pgbouncer/update-version/pb-update.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: kubedb.com/v1
kind: PgBouncer
metadata:
name: pb-update
namespace: demo
spec:
replicas: 1
version: "1.18.0"
database:
syncUsers: true
databaseName: "postgres"
databaseRef:
name: "ha-postgres"
namespace: demo
connectionPool:
poolMode: session
port: 5432
reservePoolSize: 5
maxClientConnections: 87
defaultPoolSize: 2
minPoolSize: 1
authType: md5
deletionPolicy: WipeOut
11 changes: 11 additions & 0 deletions docs/examples/pgbouncer/update-version/pbops-update.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: ops.kubedb.com/v1alpha1
kind: PgBouncerOpsRequest
metadata:
name: pgbouncer-version-update
namespace: demo
spec:
type: UpdateVersion
databaseRef:
name: pb-update
updateVersion:
targetVersion: 1.23.1
23 changes: 15 additions & 8 deletions docs/guides/pgbouncer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,21 @@ KubeDB operator now comes bundled with PgBouncer crd to handle connection poolin

## PgBouncer Features

| Features | Availability |
|------------------------------------|:------------:|
| Clustering | &#10003; |
| Multiple PgBouncer Versions | &#10003; |
| Customizable Pooling Configuration | &#10003; |
| Custom docker images | &#10003; |
| Builtin Prometheus Discovery | &#10003; |
| Using Prometheus operator | &#10003; |
| Features | Availability |
|-------------------------------------------------------------| :----------: |
| Multiple PgBouncer Versions | &#10003; |
| Custom Configuration | &#10003; |
| Externally manageable Auth Secret | &#10003; |
| Reconfigurable Health Checker | &#10003; |
| Integrate with externally managed PostgreSQL | &#10003; |
| Sync Postgres Users to PgBouncer | &#10003; |
| Custom docker images | &#10003; |
| TLS: Add ( [Cert Manager]((https://cert-manager.io/docs/))) | &#10003; |
| Monitoring with Prometheus & Grafana | &#10003; |
| Builtin Prometheus Discovery | &#10003; |
| Using Prometheus operator | &#10003; |
| Alert Dashboard | &#10003; |
| Grafana Dashboard | &#10003; |

## User Guide

Expand Down
10 changes: 10 additions & 0 deletions docs/guides/pgbouncer/autoscaler/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
title: Autoscaling
menu:
docs_{{ .version }}:
identifier: pb-auto-scaling
name: Autoscaling
parent: pb-pgbouncer-guides
weight: 46
menu_name: docs_{{ .version }}
---
10 changes: 10 additions & 0 deletions docs/guides/pgbouncer/autoscaler/compute/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
title: Compute Autoscaling
menu:
docs_{{ .version }}:
identifier: pb-compute-auto-scaling
name: Compute Autoscaling
parent: pb-auto-scaling
weight: 10
menu_name: docs_{{ .version }}
---
Loading

0 comments on commit 6d67a6e

Please sign in to comment.