kepler
kepler copied to clipboard
kepler_container_joules_total stays costant over time
What happened?
I installed kepler on a local kind cluster following the documentation, specifically using the make cluster-up command. I installed the last version of Kepler: release-0.7.10. My hardware is Mac with intel processor.
I then run a simple python code to check what was the consumption for demo purpose.
This is the simple python code:
# inefficient_fibonacci.py
import os
def inefficient_fibonacci(n):
if n <= 1:
return n
return inefficient_fibonacci(n-1) + inefficient_fibonacci(n-2)
def calculate_fibonacci(n):
return inefficient_fibonacci(n)
if __name__ == "__main__":
n = os.getenv("INPUT")
result = calculate_fibonacci(int(n))
print(f"Fibonacci of {n} is: {result}")
This is the dockerfile:
FROM python:latest
WORKDIR /app
COPY fibonacci-infeccient.py ./app.py
CMD ["python", "app.py"]
And this is the simple pod.yaml I used to deploy:
apiVersion: v1
kind: Pod
metadata:
name: fibonacci-inefficient
spec:
containers:
- name: fibonacci-inefficient
image: fibonacci-inefficient:latest
imagePullPolicy: Never
env:
- name: INPUT
value: "995" # a high value to observe the behavior
What did you expect to happen?
When querying in grafana the simple metric: namely kepler_container_joules_total The value of the metric does not increase over time. It stays costant, the queries with mode=idle and mode=dynamic return different numbers but still costant.
Since the container is always on and uses constantly the following resources:
k top pods
NAME CPU(cores) MEMORY(bytes)
fibonacci-inefficient 1000m 4Mi
I would have expected the energy value to rise. But that is not the case. Why? I am attaching a screen of the grafana:
[EDIT] from the screenshot it might seem that I observed this only for few minutes and I did not give enough time to the power models to "trigger a change" in the output. However observing the process for 1h also made no difference, the energy stays constant
Am I missing something?
How can we reproduce it (as minimally and precisely as possible)?
- Get a Mac with intel chip
- Deploy local kind cluster using make cluster-up
- Install latest version (release 0.7.10) using helm file as per docs
- Build the docker image and Deploy it on the kind registry:
kind load docker-image $IMAGE_NAME
- Apply the pod file
- Check this query on grafana:
kepler_container_joules_total{pod_name="fibonacci-inefficient"}
Anything else we need to know?
No response
Kepler image tag
Kubernetes version
$ kubectl version
1.30.0
Cloud provider or bare metal
OS version
# On Linux:
$ cat /etc/os-release
# paste output here
$ uname -a
# paste output here
# On Windows:
C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture
# paste output here
Install tools
Kepler deployment config
For on kubernetes:
$ KEPLER_NAMESPACE=kepler
# provide kepler configmap
$ kubectl get configmap kepler-cfm -n ${KEPLER_NAMESPACE}
# paste output here
# provide kepler deployment description
$ kubectl describe deployment kepler-exporter -n ${KEPLER_NAMESPACE}
For standalone: