Scalar-Operator is a Kubernetes Operator designed to simplify scaling up deployments effortlessly.
To get started with the Scalar-Operator, follow the steps below:
- Clone the repository from GitHub:
git clone https://github.com/YashPimple/scalar-operator.git cd scalar-operator
- Generate the Kubernetes manifests:
make manifests
- Apply the Custom Resource Definition (CRD):
kubectl apply -f config/crd/bases/api.scalaroperator.io_scalars.yaml
- Deploy an nginx deployment on your cluster (or any other deployment you wish to scale):
kubectl create deployment nginx --image=nginx
- Check the number of replicas running:
kubectl get pods
- Scale up the replicas using the Scalar-Operator:
make run
- Open another terminal and apply the Scalar custom resource to scale up the replicas:
kubectl apply -f config/samples/api_v4alpha1_scaler.yaml
- Finally, check the number of replicas:
kubectl get pods
- Output
You should see an output similar to the following:
yashpimple@Yashs-Air ~ % kubectl get pods NAME READY STATUS RESTARTS AGE nginx-8f458dc5b-ls5wk 0/1 ContainerCreating 0 2s nginx-8f458dc5b-nlbg7 0/1 ContainerCreating 0 2s nginx-8f458dc5b-rk588 0/1 ContainerCreating 0 2s nginx-8f458dc5b-tz6jl 0/1 ContainerCreating 0 2s nginx-8f458dc5b-wz97m 1/1 Running 0 29s