Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Complete PgBouncer Docs #718

Merged
merged 29 commits into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
4f3d7a8
Signed-off-by: Hiranmoy Das Chowdhury <[email protected]>
HiranmoyChowdhury Nov 18, 2024
4852b58
update-version
HiranmoyChowdhury Nov 20, 2024
0788185
scaling done
HiranmoyChowdhury Nov 20, 2024
2bf2139
autoScaler
HiranmoyChowdhury Nov 21, 2024
6b616b0
reconfiguration
HiranmoyChowdhury Nov 21, 2024
2ebe6d1
restart
HiranmoyChowdhury Nov 21, 2024
f9a201c
monitoring
HiranmoyChowdhury Nov 22, 2024
fe2f925
Signed-off-by: Hiranmoy Das Chowdhury <[email protected]>
HiranmoyChowdhury Nov 25, 2024
38b3706
all completed until custom version
HiranmoyChowdhury Nov 26, 2024
046169a
update version svg
HiranmoyChowdhury Nov 27, 2024
df9ba0d
completed till update-version
HiranmoyChowdhury Nov 27, 2024
684da43
Horizontal scaling done
HiranmoyChowdhury Nov 27, 2024
3d680d4
vertical scaling done fully
HiranmoyChowdhury Nov 27, 2024
0434c41
autoscaling all done
HiranmoyChowdhury Nov 28, 2024
93cb4ab
all done for reconfiguration
HiranmoyChowdhury Nov 28, 2024
c902d66
restart done
HiranmoyChowdhury Nov 28, 2024
941fe5d
duplication removed
HiranmoyChowdhury Dec 11, 2024
cafaaf9
build fixed
HiranmoyChowdhury Dec 11, 2024
a35e5c9
remove reconfigure tls
HiranmoyChowdhury Dec 11, 2024
eb0ceec
image added for monitoring
HiranmoyChowdhury Dec 11, 2024
2753d25
pgbouncer wiki change
HiranmoyChowdhury Dec 12, 2024
652a868
autoscaling issue fixed
HiranmoyChowdhury Dec 12, 2024
de88b4f
test
HiranmoyChowdhury Dec 12, 2024
14ac3ca
test 2
HiranmoyChowdhury Dec 12, 2024
0f86569
test 3
HiranmoyChowdhury Dec 12, 2024
f40ac29
update version camel case removed
HiranmoyChowdhury Dec 12, 2024
d03be11
monitoring part is done
HiranmoyChowdhury Dec 12, 2024
17b4b93
image changes for monitoring
HiranmoyChowdhury Dec 12, 2024
0e730eb
camecase solved
HiranmoyChowdhury Dec 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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