Kepler Community Operator on OpenShift
Before you start make sure you have:
- An OCP 4.13 cluster running
- Signed in as
kubeadminor a user with
- Clone the kepler-operator repository.
git clone https://github.com/sustainable-computing-io/kepler-operator.git cd kepler-operator
Remove previously installed version of the Kepler Community Operator
If you have previously installed the Kepler Community Operator this will need
to be removed prior to the installation of the
v0.8.z version of the operator.
This is due to changes to the Kepler API that are backward incompatible.
Please also note that
v1alpha does not promise backward compatibility and backward incompatible changes are expected until the API matures to
- Run the uninstall script to check the installed version of the operator
Sample output of the command
🔔 No operator version specified; finding the installed version ✅ found kepler-operator csv: clusterserviceversion.operators.coreos.com/kepler-operator.v0.8.1 ✅ kepler-operator version: v0.8.1 ✅ Found - Kepler Operator version: v0.8.1 🔆🔆🔆 Resources of Kepler Operator - v0.8.1 🔆🔆🔆 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ NAME DISPLAY VERSION REPLACES PHASE kepler-operator.v0.8.1 Kepler 0.8.1 kepler-operator.v0.8.0 Succeeded 🔆🔆🔆 Going to delete the following 🔆🔆🔆 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ❯ kubectl get ns kepler Error from server (NotFound): namespaces "kepler" not found ❯ kubectl get kepler -A NAME PORT DESIRED CURRENT READY UP-TO-DATE AVAILABLE AGE kepler 9103 17 17 17 17 17 12h ❯ kubectl get -n openshift-operators olm -l operators.coreos.com/kepler-operator.openshift-operators= NAME AGE operatorcondition.operators.coreos.com/kepler-operator.v0.8.1 12h .... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 🔔 To delete all resources listed above, rerun with --delete option added. ./hack/uninstall-operator.sh --delete
- Once the above is verified, uninstall the operator and all the related resources by specifying the --delete flag.
Install Kepler Community Operator from Operator Hub
- Go to Operators ❯ OperatorHub. Search for
Kepler. Click on Kepler Operator tile, then select
dev-previewchannel for deploying the
developer previewversion of the Operator respectively.
- Click on
dev-preview channel will only be updated until developer-preview is finalized.
- Wait until Operator gets installed
Follow the link to view installed Operators in
or use the UI to navigate to installed operators and select the Kepler
Create instanceto Create a Custom Resource for Kepler
- There is a
YAMLview, using the YAML view provides more detail.
Once Kepler is configured select
Check that the Availability status of Kepler Instance should be
- Check that the Kepler is deployed and available
oc get kepler kepler
NAME PORT DESIRED CURRENT READY UP-TO-DATE AVAILABLE AGE kepler 9103 6 6 6 6 6 33s
The Kepler Dashboard provides the ability to visualize data exported by Kepler thus facilitating data-driven insights and a clear and interactive overview of metrics. Currently, we can visualize Kepler related metrics either via deploying Grafana dashboard on OpenShift or directly via OpenShift Console.
To view the metrics directly from OpenShift Console
- Configure user workload monitoring on the cluster. Refer to the official OpenShift documentation for more information.
- Navigate to Observe ❯ Dashboard
- To view overall power consumption select
Power Monitoring / Overviewfrom dropdown.
- To view the power consumption by namespace select
Power Monitoring / Namespacefrom dropdown.
Deploy the Grafana Dashboard
- Run the Grafana deployment script
The script takes a few minutes to complete. The script automates the following steps:
- Setup OpenShift User Workload Monitoring.
- Install the Grafana Community Operator inside
- Setup Grafana related dependencies e.g. ServiceAccount, Grafana DataSource, Grafana Dashboard and Route
When the script successfully completes it provides the OpenShift Route to the Kepler Dashboard.
🔆🔆🔆 Grafana Dashboard Setup Complete 🔆🔆🔆 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 📈 Grafana Configuration: Dashboard URL: https://grafana-route-kepler-grafana.apps.devcluster.openshift.com/login Admin: kepler Password: kepler ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 🔔 Kepler use prometheus deployed in openshift-user-workload-monitoring to store metrics. To configure Prometheus to cater to needs of the cluster such as: * Increase data retention for in-depth analysis * Allocate more resources based on requirements 💡 see: https://docs.openshift.com/container-platform/latest/monitoring/configuring-the-monitoring-stack.html#configuring-the-monitoring-stack_configuring-the-monitoring-stack ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Sign in to the Grafana dashboard using the credentials
Access the Grafana Console Route
The dashboard can also be accessed through the OCP UI, Go to Networking ❯ Routes.
Grafana Deployment Overview
Refer to the Grafana Deployment Overview
Frequently Asked Questions
Will Kepler work on earlier releases of OpenShift?
Our recommendation is use
OCP 4.13 but Kepler has been installed on
4.12. In future the Operator may be updated to check the version of
kubernetes that is installed e.g.
How do I set nodeSelector and tolerations for Kepler?
You can specify nodeSelector and toleration's for Kepler at the time of creating Instance. You can specify both in
- To specify in
spec: exporter: deployment: port: 9103 nodeSelector: foo: bar tolerations: - key: foo operator: "Equal" value: bar effect: NoExecute
Where is Kepler exporter pods deployed?
Once Kepler Instance is created all the related resources like pods, daemonsets, configmaps, secret's etc. are present inside
openshift-kepler-operator namespace. To view the available resources:
oc get all -n openshift-kepler-operator
How do I enable libbpf images?
NOTE: This method for enabling
libbpf will only be applicable until the release of Kepler version
0.7. Following this update,
libbpf will become the default, and support for
bcc will be phased out.
libbpf images, simply add the necessary annotations to your Kepler instance during its creation in
apiVersion: kepler.system.sustainable.computing.io/v1alpha1 kind: Kepler metadata: annotations: kepler.sustainable.computing.io/bpf-attach-method: libbpf labels: app.kubernetes.io/name: kepler app.kubernetes.io/instance: kepler app.kubernetes.io/part-of: kepler-operator name: kepler spec: exporter: deployment: port: 9103