Reducing the carbon footprint and CO2 emission of our (cloud) workloads, is a responsibility of all of us. If you are running a Kubernetes cluster, have a look at Kube-Green.
kube-green is a simple Kubernetes operator that automatically shuts down (some of) your pods when you don't need them. A single pod produces about 11 Kg CO2eq per year(here the calculation).
Reason enough to give it a try!
Installing kube-green in your cluster
The easiest way to install the operator in your cluster is through kubectl.
We first need to install a cert-manager:
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.14.5/cert-manager.yaml
Remark: Wait a minute before you continue as it can take some time before the cert-manager is up & running inside your cluster.
Now we can install the kube-green operator:
kubectl apply -f https://github.com/kube-green/kube-green/releases/latest/download/kube-green.yaml
Now in the namespace where we want to enable kube-green, we can apply the SleepInfo CRD. Here is an example:
As you can see above this configuration will stop deployment resources and cronjobs from Monday to Friday at 20PM and wake them up again at 8AM European time. More details about the configuration options can be found here.
More information
GitHub - kube-green/kube-green: A K8s operator to reduce CO2 footprint of your clusters