Skip to content

Commit

Permalink
autoscaling all done
Browse files Browse the repository at this point in the history
Signed-off-by: Hiranmoy Das Chowdhury <[email protected]>
  • Loading branch information
HiranmoyChowdhury committed Nov 28, 2024
1 parent 6d2c479 commit eb4784c
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 5 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"
4 changes: 0 additions & 4 deletions docs/guides/pgbouncer/autoscaler/compute/compute-autoscale.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ Let's check the Pod containers resources,
$ kubectl get pod -n demo pgbouncer-autoscale-0 -o json | jq '.spec.containers[].resources'
{
"limits": {
"cpu": "200m",
"memory": "300Mi"
},
"requests": {
Expand All @@ -112,7 +111,6 @@ Let's check the PgBouncer resources,
$ kubectl get pgbouncer -n demo pgbouncer-autoscale -o json | jq '.spec.podTemplate.spec.containers[0].resources'
{
"limits": {
"cpu": "200m",
"memory": "300Mi"
},
"requests": {
Expand Down Expand Up @@ -403,7 +401,6 @@ Now, we are going to verify from the Pod, and the PgBouncer yaml whether the res
$ kubectl get pod -n demo pgbouncer-autoscale-0 -o json | jq '.spec.containers[].resources'
{
"limits": {
"cpu": "400m",
"memory": "400Mi"
},
"requests": {
Expand All @@ -415,7 +412,6 @@ $ kubectl get pod -n demo pgbouncer-autoscale-0 -o json | jq '.spec.containers[]
$ kubectl get pgbouncer -n demo pgbouncer-autoscale -o json | jq '.spec.podTemplate.spec.containers[0].resources'
{
"limits": {
"cpu": "400m",
"memory": "400Mi"
},
"requests": {
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/pgbouncer/autoscaler/compute/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ This guide will give an overview on how KubeDB Autoscaler operator autoscales th
The following diagram shows how KubeDB Autoscaler operator autoscales the resources of `PgBouncer`. Open the image in a new tab to see the enlarged version.

<figure align="center">
  <img alt="Compute Auto Scaling process of PgBouncer" src="/docs/images/day-2-operation/pgbouncer/compute-process.png">
  <img alt="Compute Auto Scaling process of PgBouncer" src="/docs/images/day-2-operation/pgbouncer/autoscaling.png">
<figcaption align="center">Fig: Compute Auto Scaling process of PgBouncer</figcaption>
</figure>

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit eb4784c

Please sign in to comment.