Skip to content

Commit

Permalink
document servicemonitor and configuration
Browse files Browse the repository at this point in the history
Signed-off-by: Scott Trent <[email protected]>
  • Loading branch information
trent-s committed Aug 29, 2024
1 parent e1eb868 commit 8386139
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions doc/helm-installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions doc/operatorhub-installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 8386139

Please sign in to comment.