I am trying to deploy Pega 24.2 on EKS.
I would like to scale the Pega-web pods based on a schedule.
Is this possible?
I am trying to deploy Pega 24.2 on EKS.
I would like to scale the Pega-web pods based on a schedule.
Is this possible?
are you able to access the MSP GenAI Buddy? Please see if the answer helps you.
Via other references our GenAI came up with this response: All generated answers require validation against the provided references.
------------------------------------------------------------------------
it is possible to scale Pega-web pods based on a schedule when deploying Pega 24.2 on EKS. There are two main approaches you can use for implementing this capability:
You can create CronJobs in your Kubernetes cluster that execute scaling commands at predetermined times. This is particularly useful for predictable scaling needs, such as reducing resources during off-hours and scaling up before business hours.
Here’s how you can implement this:
kubectl scale command to modify the replica count of your Pega-web deployment at specific times.apiVersion: batch/v1
kind: CronJob
metadata:
name: scale-pegaweb-up
spec:
schedule: "0 8 * * 1-5" # 8:00 AM Monday-Friday
jobTemplate:
spec:
template:
spec:
serviceAccountName: scaling-account # Account with permissions to scale deployments
containers:
- name: kubectl
image: bitnami/kubectl:latest
command:
- /bin/sh
- -c
- kubectl scale deployment pega-web --replicas=10
restartPolicy: OnFailure
---
apiVersion: batch/v1
kind: CronJob
metadata:
name: scale-pegaweb-down
spec:
schedule: "0 20 * * 1-5" # 8:00 PM Monday-Friday
jobTemplate:
spec:
template:
spec:
serviceAccountName: scaling-account
containers:
- name: kubectl
image: bitnami/kubectl:latest
command:
- /bin/sh
- -c
- kubectl scale deployment pega-web --replicas=2
restartPolicy: OnFailure
Alternatively, if you’re already using the Horizontal Pod Autoscaler (HPA) for your Pega deployment, you can create CronJobs that modify the HPA’s minimum and maximum replicas at scheduled times:
apiVersion: batch/v1
kind: CronJob
metadata:
name: modify-hpa-business-hours
spec:
schedule: "0 8 * * 1-5" # 8:00 AM Monday-Friday
jobTemplate:
spec:
template:
spec:
serviceAccountName: scaling-account
containers:
- name: kubectl
image: bitnami/kubectl:latest
command:
- /bin/sh
- -c
- kubectl patch hpa pega-web-hpa --patch '{"spec":{"minReplicas":5,"maxReplicas":20}}'
restartPolicy: OnFailure
---
apiVersion: batch/v1
kind: CronJob
metadata:
name: modify-hpa-off-hours
spec:
schedule: "0 20 * * 1-5" # 8:00 PM Monday-Friday
jobTemplate:
spec:
template:
spec:
serviceAccountName: scaling-account
containers:
- name: kubectl
image: bitnami/kubectl:latest
command:
- /bin/sh
- -c
- kubectl patch hpa pega-web-hpa --patch '{"spec":{"minReplicas":2,"maxReplicas":5}}'
restartPolicy: OnFailure
Reference