Ce contenu n'est pas disponible dans la langue sélectionnée.
Chapter 4. Configuring power monitoring
Power monitoring is a Technology Preview feature only. Technology Preview features are not supported with Red Hat production service level agreements (SLAs) and might not be functionally complete. Red Hat does not recommend using them in production. These features provide early access to upcoming product features, enabling customers to test functionality and provide feedback during the development process.
For more information about the support scope of Red Hat Technology Preview features, see Technology Preview Features Support Scope.
The Kepler
resource is a Kubernetes custom resource definition (CRD) that enables you to configure the deployment and monitor the status of the Kepler resource.
4.1. The Kepler configuration
You can configure Kepler with the spec
field of the Kepler
resource.
Ensure that the name of your Kepler instance is kepler
. All other instances are rejected by the Power monitoring Operator Webhook.
The following is the list of configuration options:
Name | Spec | Description | Default |
---|---|---|---|
|
| The port on the node where the Prometheus metrics are exposed. |
|
|
| The nodes on which Kepler exporter pods are scheduled. |
|
|
| The tolerations for Kepler exporter that allow the pods to be scheduled on nodes with specific characteristics. |
|
Example Kepler
resource with default configuration
apiVersion: kepler.system.sustainable.computing.io/v1alpha1 kind: Kepler metadata: name: kepler spec: exporter: deployment: port: 9103 1 nodeSelector: kubernetes.io/os: linux 2 Tolerations: 3 - key: "" operator: "Exists" value: "" effect: ""
4.2. Monitoring the Kepler status
You can monitor the state of the Kepler exporter with the status
field of the Kepler
resource.
The status.exporter
field includes information, such as the following:
- The number of nodes currently running the Kepler pods
- The number of nodes that should be running the Kepler pods
- Conditions representing the health of the Kepler resource
This provides you with valuable insights into the changes made through the spec
field.
Example state of the Kepler
resource
apiVersion: kepler.system.sustainable.computing.io/v1alpha1 kind: Kepler metadata: name: kepler status: exporter: conditions: 1 - lastTransitionTime: '2024-01-11T11:07:39Z' message: Reconcile succeeded observedGeneration: 1 reason: ReconcileSuccess status: 'True' type: Reconciled - lastTransitionTime: '2024-01-11T11:07:39Z' message: >- Kepler daemonset "kepler-operator/kepler" is deployed to all nodes and available; ready 2/2 observedGeneration: 1 reason: DaemonSetReady status: 'True' type: Available currentNumberScheduled: 2 2 desiredNumberScheduled: 2 3
4.3. Configuring Kepler to use Redfish
You can configure Kepler to use Redfish as the source for running or hosting containers. Kepler can then monitor the power usage of these containers.
Prerequisites
- You have access to the OpenShift Container Platform web console.
-
You are logged in as a user with the
cluster-admin
role. - You have installed the Power monitoring Operator.
Procedure
-
In the Administrator perspective of the web console, click Operators
Installed Operators. - Click Power monitoring for Red Hat OpenShift from the Installed Operators list and click the Kepler tab.
- Click Create Kepler. If you already have a Kepler instance created, click Edit Kepler.
Configure
.spec.exporter.redfish
of the Kepler instance by specifying the mandatorysecretRef
field. You can also configure the optionalprobeInterval
andskipSSLVerify
fields to meet your needs.Example Kepler instance
apiVersion: kepler.system.sustainable.computing.io/v1alpha1 kind: Kepler metadata: name: kepler spec: exporter: deployment: # ... redfish: secretRef: <secret_name> required 1 probeInterval: 60s 2 skipSSLVerify: false 3 # ...
- 1
- Required: Specifies the name of the secret that contains the credentials for accessing the Redfish server.
- 2
- Optional: Controls the frequency at which the power information is queried from Redfish. The default value is
60s
. - 3
- Optional: Controls if Kepler skips verifying the Redfish server certificate. The default value is
false
.
NoteAfter Kepler is deployed, the
openshift-power-monitoring
namespace is created.Create the
redfish.csv
file with the following data format:<your_kubelet_node_name>,<redfish_username>,<redfish_password>,https://<redfish_ip_or_hostname>/
Example
redfish.csv
filecontrol-plane,exampleuser,examplepass,https://redfish.nodes.example.com worker-1,exampleuser,examplepass,https://redfish.nodes.example.com worker-2,exampleuser,examplepass,https://another.redfish.nodes.example.com
Create the secret under the
openshift-power-monitoring
namespace. You must create the secret with the following conditions:-
The secret type is
Opaque
. -
The credentials are stored under the
redfish.csv
key in thedata
field of the secret.
$ oc -n openshift-power-monitoring \ create secret generic redfish-secret \ --from-file=redfish.csv
Example output
apiVersion: v1 kind: Secret metadata: name: redfish-secret data: redfish.csv: YmFyCg== # ...
ImportantThe Kepler deployment will not continue until the Redfish secret is created. You can find this information in the
status
of a Kepler instance.-
The secret type is