Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Cloudjoule - support for Kubernetes #31

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

PierreRustOrange
Copy link
Contributor

This adds support for Kubernetes to smartwatts.

Main features

  • Support for configuration through environment variables (partial support only, this should be bleanup up and moved to powerAPI instead of smartwatts)
  • modifier agent, that monitors K8S and add K8S metatdata to reports (label, namespace, pod name, etc.)
  • prometheus exporter with gauge and counter (should be preferred for such metrics with prometheus). This exporter exposes k8s metadata for all monitored pods.

This PR should be used as a basis for discussion, some code should most probably be moved to the PowerAPI repository and more care should be payed to make sure we don't cause any issue when running smartwatts outside k8s.

This adds support for configuring some key parameter using environment
variables. This is useful, and recommended (cf. twelve-factor app), when
running in a environment where changing
the configuration file across deployments (e.g. k8s in our case).

At the moment, only a subset of configuration parameters are supported.
It's currently quite a hack and should probably be merged with the
existing configuration mechanism, which currently supports file and cli
arguments.

Signed-off-by: Pierre Rust <[email protected]>
This module provides two k8s specific actors
* `K8sMdtModifierActor`, which add k8s metadata to reports
  and forward them to another actor.
* `K8sMonitorAgent`, which monitors the k8s API and sends
  messages when pod are created, removed or modified.

Signed-off-by: Pierre Rust <[email protected]>
This exporter exposes one gauge and one counter metric
* for rapl energy (total cpu energy usage)
* for the global energy usage estimated by powerAPI
* for the estimated energy usage of each pod (filtered by labels)

Signed-off-by: Pierre Rust <[email protected]>
Adds configuration and launches the modifier agent for K8S metadata.

Signed-off-by: Pierre Rust <[email protected]>
@gfieni gfieni changed the title Cloudjoule - support for Kubernetes [WIP] Cloudjoule - support for Kubernetes Feb 20, 2023
@gfieni gfieni force-pushed the master branch 3 times, most recently from 2ee2d57 to 168bc3a Compare May 3, 2023 14:18
@sonarqubecloud
Copy link

sonarqubecloud bot commented Oct 4, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot E 1 Security Hotspot
Code Smell A 11 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant