https://github.com/sustainable-computing-io/clever
Container Level Energy-efficient VPA Recommender
https://github.com/sustainable-computing-io/clever
kubernetes machine-learning sustainability vertical-scaling
Last synced: about 1 year ago
JSON representation
Container Level Energy-efficient VPA Recommender
- Host: GitHub
- URL: https://github.com/sustainable-computing-io/clever
- Owner: sustainable-computing-io
- License: apache-2.0
- Created: 2022-05-18T15:03:02.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2025-04-10T05:28:09.000Z (about 1 year ago)
- Last Synced: 2025-04-10T06:34:14.597Z (about 1 year ago)
- Topics: kubernetes, machine-learning, sustainability, vertical-scaling
- Language: Python
- Homepage:
- Size: 46.9 KB
- Stars: 25
- Watchers: 3
- Forks: 4
- Open Issues: 20
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# CLEVER
Container Level Energy-efficient VPA Recommender for Kubernetes
## Pre-requisites
- Baremetal Node OS - RedHat 8
- Kubernetes 1.22+
- Kepler v0.2
- Prometheus release-0.11
- Kubernetes Vertical Pod Autoscaler (VPA) 0.11
## Installation
### Install Kepler
- Follow the instructions in the [Kepler](https://github.com/sustainable-computing-io/kepler) to install Kepler as DaemonSets on nodes of the Kubernetes Cluster.
### Install Prometheus & Grafana Dashboard
- Follow the instructions in the [kube-prometheus](https://github.com/prometheus-operator/kube-prometheus) to install both Prometheus and Grafana on the Kubernetes Cluster.
- Import the [Grafana Dashboard](https://grafana.com/docs/grafana/v9.0/dashboards/export-import/). The dashboard is available in the `dashboards/clever-dashboard.json` folder.
- Access Prometheus UI and Grafana Dashboard via `kubectl port-forward` command following the [Access UIs tutorial](https://github.com/prometheus-operator/kube-prometheus/blob/main/docs/access-ui.md).
### Install VPA
- Follow the instructions [here](https://github.com/kubernetes/autoscaler/blob/master/vertical-pod-autoscaler/README.md) to install the VPA on the Kubernetes Cluster.
### Install CLEVER
- Clone the CLEVER repository
```bash
git clone https://github.com/sustainable-computing-io/clever.git
```
- Deploy CLEVER Recommender to run as an alternative recommender for VPA.
```bash
kubectl apply -f manifests/clever.yaml
```
## Tutorial
- Deploy the example application that selects the CLEVER recommender for VPA.
```bash
kubectl apply -f manifests/random.yaml
```
- The example application defines a VPA Custom Resource with the following configuration:
```yaml
apiVersion: "autoscaling.k8s.io/v1"
kind: VerticalPodAutoscaler
metadata:
name: random-vpa
spec:
recommenders:
- name: clever
targetRef:
apiVersion: "apps/v1"
kind: Deployment
name: random
resourcePolicy:
containerPolicies:
- containerName: '*'
minAllowed:
cpu: 100m
maxAllowed:
cpu: 16
controlledResources: ["cpu"]
```
- Monitor the recommended CPU requests for the example application by watching the VPA object.
```bash
watch -n 0.1 ./scripts/vpa.sh random-vpa
```
- Change the node CPU frequencies to observe the effect on the recommended CPU requests.
```bash
./scripts/set_cpu_freq.sh 1GHz
```