From 8386139366c23817c915e9bae851bcab9e5bbb0e Mon Sep 17 00:00:00 2001 From: Scott Trent Date: Thu, 29 Aug 2024 10:09:28 +0900 Subject: [PATCH] document servicemonitor and configuration Signed-off-by: Scott Trent --- README.md | 2 +- doc/helm-installation.md | 7 ++++++ doc/operatorhub-installation.md | 5 ++++ ...nitoring.coreos.com_v1_servicemonitor.yaml | 23 +++++++++++++++++++ 4 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 hack/susql-operator-susql-controller-manager-metrics-monitor_monitoring.coreos.com_v1_servicemonitor.yaml diff --git a/README.md b/README.md index 5c17ace..6544c3f 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ The configmap user configurable items are: - `CARBON-LOCATION` - The location identifiers are defined by the API provider, but can be selected by he user. - `CARBON-QUERY-RATE` - Interval in seconds at which the carbon intensity is queried. The data available from the source is updated less than hourly, so an interval of greater than 3600 seconds is recommended. - `CARBON-QUERY-FILTER` - When the return value is embedded in a JSON object, this specification enables the extraction of the data. The default value matches the default provider. - - `CARBON-QUERY-CONV-2J` - If the carbon data provider does not provide data in the standard "grams of CO2 per Joule" then, this factor can be specified to normalize the units displayed. The default value ensures tha the default provider data is in the correct unit. + - `CARBON-QUERY-CONV-2J` - If the carbon data provider does not provide data in the standard "grams of CO2 per Joule" then this factor can be specified to normalize the units displayed. The default value ensures that the default provider data is in the correct unit. - The third method "sdk" is still under development, and will offer an integration with the Green Software Foundation's [Carbon Aware SDK](https://github.com/Green-Software-Foundation/carbon-aware-sdk). ### Prerequisites diff --git a/doc/helm-installation.md b/doc/helm-installation.md index 21198a7..6d57d4c 100644 --- a/doc/helm-installation.md +++ b/doc/helm-installation.md @@ -65,7 +65,14 @@ The following environment variables will influence the way that the SusQL Operat | SUSQL_REGISTRY | quay.io/sustainable_computing_io | Container registry that SusQL is stored in | | SUSQL_IMAGE_NAME | susql_operator | Image name used on SusQL container registry | | SUSQL_IMAGE_TAG | latest | Tag for SusQL container | +| CARBON_METHOD | static | "static", "simpledynamic", "sdk" | | CARBON_INTENSITY | "0.00011583333" | Carbon intensity in grams CO2 / Joule | +| CARBON_INTENSITY_URL | | Web API to query carbon intensity | +| CARBON_LOCATION | | Location for carbon intensity query | +| CARBON_QUERY_RATE | 7200 | # of seconds between carbon intensity queries | +| CARBON_QUERY_FILTER | carbonIntensity | JSON identifer of carbon intensity value | +| CARBON_QUERY_CONV_2J | | Convert to grams CO2/J | + ## License diff --git a/doc/operatorhub-installation.md b/doc/operatorhub-installation.md index 3d810b5..4ad2f21 100644 --- a/doc/operatorhub-installation.md +++ b/doc/operatorhub-installation.md @@ -49,6 +49,11 @@ could create the configMap with `oc apply -n YOURNAMESPACE -f susql-config.yaml` If you update (or create) the configMap after the SusQL Operator has been installed, then restarting the SusQL Operator controller pod will enable the changes. (e.g., Delete the pod, and allow it to be recreated automatically.) +# Post Installation Steps + +After installing the SusQL Operator be sure to enable the service monitor. This will enable energy and carbon data to be +viewed with cluster observability tools such as the "Observe->Metrics" graphs with OpenShift. +`oc apply -n openshift-operators -f https://raw.githubusercontent.com/sustainable-computing-io/susql-operator/main/hack/susql-operator-susql-controller-manager-metrics-monitor_monitoring.coreos.com_v1_servicemonitor.yaml` ## License diff --git a/hack/susql-operator-susql-controller-manager-metrics-monitor_monitoring.coreos.com_v1_servicemonitor.yaml b/hack/susql-operator-susql-controller-manager-metrics-monitor_monitoring.coreos.com_v1_servicemonitor.yaml new file mode 100644 index 0000000..68d62a7 --- /dev/null +++ b/hack/susql-operator-susql-controller-manager-metrics-monitor_monitoring.coreos.com_v1_servicemonitor.yaml @@ -0,0 +1,23 @@ +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + labels: + app.kubernetes.io/component: metrics + app.kubernetes.io/created-by: susql-operator + app.kubernetes.io/instance: susql-controller-manager-metrics-monitor + app.kubernetes.io/managed-by: kustomize + app.kubernetes.io/name: servicemonitor + app.kubernetes.io/part-of: susql-operator + control-plane: susql-controller-manager + name: susql-operator-susql-controller-manager-metrics-monitor +spec: + endpoints: + - bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token + path: /metrics + port: https + scheme: https + tlsConfig: + insecureSkipVerify: true + selector: + matchLabels: + control-plane: susql-controller-manager