Skip to content

nikimanoledaki/gitops-energy-usage-notes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Energy-efficient Kubernetes

This project aims to measure and compare the energy consumption of snowflake clusters versus that of Flux-based GitOps clusters.

Another aim is to create a reference architecture for measuring the energy consumption of cloud-native processes using cloud-native tools.

The focus here is on energy usage rather than, for example, marginal emissions estimates. That being said, energy metrics could be used to deduce carbon emissions.

This project could be used as the base model for conducting Life Cycle Assessment (LCAs) of any cloud-native software that runs on a Pod.


[Update] The latest version of this project can be found here: https://github.com/nikimanoledaki/sustainability-journey-with-gitops


Resources

Get Started with Local Development

OS

Linux

For Linux users, create a cluster directly with minikube.

MacOS

For MacOS user, the dependencies are:

  • Virtualbox - brew install --cask virtualbox
  • Vagrant - brew install --cask vagrant

Then, use this Vagrantfile, and spin up a microVM with Flintlock:

vagrant up
vagrant ssh

Note: The Vagrantfile allocates 8GB for the microVM. The microVM itself is very lightweight but the cluster that will be allocated 6GB. Ensure you have enough RAM.

Start a Kubernetes cluster with minikube

First, create a minikube cluster:

minikube start --container-runtime=containerd --memory=6g --bootstrapper=kubeadm --extra-config=kubelet.authentication-token-webhook=true --extra-config=kubelet.authorization-mode=Webhook --extra-config=scheduler.bind-address=0.0.0.0 --extra-config=controller-manager.bind-address=0.0.0.0
minikube addons disable metrics-server

You will need to install kube-prometheus and kepler on your cluster.

To do this in a GitOps way, bootstrap Flux on your cluster.

Then, copy the Flux manifests for kube-prometheus and kepler to your config repo. Flux will automatically reconcile these for you.

Get Started in a Cloud Environment

### Example: Use Equinix for the Baremetal Host Liquid Metal can be used to create microVMs on any baremetal machine.

Follow thse instructions for how to use Equinix as a host baremetal machine.

Use this Terraform manifest, which contains the necessary configuration to be used as a host for Kepler.

Set up a Kubernetes management cluster locally with CAPI. Then, set up more clusters hosted on microVMs with CAPMVM.

About

Environmental Sustainability x Cloud-Native: How to measure the energy consumption of cloud-native processes

Topics

Resources

Stars

Watchers

Forks