diff --git a/docs/examples/pgbouncer/autoscaling/compute/pgbouncer-autoscale.yaml b/docs/examples/pgbouncer/autoscaling/compute/pgbouncer-autoscale.yaml new file mode 100644 index 000000000..d7cf7c1c1 --- /dev/null +++ b/docs/examples/pgbouncer/autoscaling/compute/pgbouncer-autoscale.yaml @@ -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 \ No newline at end of file diff --git a/docs/examples/pgbouncer/autoscaling/compute/pgbouncer-autoscaler.yaml b/docs/examples/pgbouncer/autoscaling/compute/pgbouncer-autoscaler.yaml new file mode 100644 index 000000000..37df8e5a7 --- /dev/null +++ b/docs/examples/pgbouncer/autoscaling/compute/pgbouncer-autoscaler.yaml @@ -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" \ No newline at end of file diff --git a/docs/guides/pgbouncer/autoscaler/compute/compute-autoscale.md b/docs/guides/pgbouncer/autoscaler/compute/compute-autoscale.md index da194603e..a137dfa44 100644 --- a/docs/guides/pgbouncer/autoscaler/compute/compute-autoscale.md +++ b/docs/guides/pgbouncer/autoscaler/compute/compute-autoscale.md @@ -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": { @@ -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": { @@ -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": { @@ -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": { diff --git a/docs/guides/pgbouncer/autoscaler/compute/overview.md b/docs/guides/pgbouncer/autoscaler/compute/overview.md index 87deb50da..ea2848cf8 100644 --- a/docs/guides/pgbouncer/autoscaler/compute/overview.md +++ b/docs/guides/pgbouncer/autoscaler/compute/overview.md @@ -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.
-  Compute Auto Scaling process of PgBouncer +  Compute Auto Scaling process of PgBouncer
Fig: Compute Auto Scaling process of PgBouncer
diff --git a/docs/images/day-2-operation/pgbouncer/autoscaling.png b/docs/images/day-2-operation/pgbouncer/autoscaling.png new file mode 100644 index 000000000..f1b2ba2f1 Binary files /dev/null and b/docs/images/day-2-operation/pgbouncer/autoscaling.png differ