Install

Build the Docker Image

make docker-build docker-push IMG=ghcr.io/kubecloudscaler/kubecloudscaler:latest

Install CRDs

make install

Deploy the Operator

make deploy IMG=ghcr.io/kubecloudscaler/kubecloudscaler:latest

Apply Sample Configurations

kubectl apply -k config/samples/

(optional) Uninstall

kubectl delete -k config/samples/
make uninstall

Install the Chart

helm install kubecloudscaler oci://ghcr.io/kubecloudscaler/kubecloudscaler/kubecloudscaler --namespace kubecloudscaler-system

Create a Scaler Custom Resource (CR)

# Example: Downscales all deployments (excluding kube-system) to 0 from 19:00 to 21:00 (Paris time) daily.
apiVersion: kubecloudscaler/v1alpha1
kind: K8s
metadata:
  name: k8s-sample
spec:
  periods:
    - time:
        recurring: true
        days:
          - all
        startTime: "19:00"
        endTime: "21:00"
        timezone: "Europe/Paris"
      minReplicas: 0
      maxReplicas: 10
      type: "down"

Apply the Configuration

kubectl apply -f <scaler-CR-file.yaml>

Clone the Repository

git clone https://github.com/kubecloudscaler/kubecloudscaler.git
cd cloudscaler

Apply Kustomize Configuration

In the repository root directory, run:

kubectl apply -k config/default

Uninstall with Kustomize

kubectl delete -k config/default