This repo contains Simple AWS EKS PreScaler code, and kubernetes manifests.
Scaler works with Custom Resource Definitions and scales kubernetes workloads using HPA. Default configuration gets scaling data from Turkey’s Football League’s fixture services and scale pods during match times.
-
Clone repo on EKS connected host.
-
Deploy CRDs (deploy/crds.yaml)
-
Create namespace (default prescaler)
-
Create custom resources
-
Deploy PreScaler (deploy/prescaler.yaml)
by default service account uses cluster-admin role. You can change role scope
scalesets.prescaler.kloia.com: This custom resource is defined cluster-wide for scaleset resource records.
- namespacename: deployment and hpa’s namespace
- deploymentname: deployment name in a specific namespace
- hpaname: hpa name for scaling
- defaultreplicas: default replica count for scaler calculation
criticalteams.prescaler.kloia.com: This custom resource is defined cluster-wide for critical teams. Scaler uses these records while scaling count calculation.
- criticalteamid: id for web service calls (for fixture services)
percents.prescaler.kloia.com: This custom resource is defined namespace-wide for scaler calculation percents.
- minpercent: minimum percent for scaler calculations
- maxpercent: maximum percent for scaler calculations
- criticalminpercent: minimum percent for critical teams scaler calculations
- criticalmaxpercent: maximum percent for critical teams scaler calculations
You can use those environments for prescaler container.
- wait: interval for service checking.
- FIXTURE_URL: fixture service URL.
- HOURS_INTERVAL_FEATURE: scaling interval hour before the match.
- HOURS_INTERVAL_PAST: scaling interval hour after the match.