From ea6e299ef3b93e1cf6b03bafb7c1b051ee236ef4 Mon Sep 17 00:00:00 2001 From: CAJNA Jarod Date: Thu, 26 Oct 2023 10:31:38 +0200 Subject: [PATCH] Add Kubernetes Deploy --- README.md | 22 + electricitymap/.dockerignore | 3 + Dockerfile => electricitymap/Dockerfile | 2 +- .../electricity.py | 1 + electricitymap/electricitymap-deploy.yaml | 23 + electricitymap/electricitymap-svc.yaml | 16 + .../requirements.txt | 0 electricitymap/service-monitor.yaml | 19 + kepler/kepler-dashboard.json | 1024 +++++++++++++++++ kepler/kepler-values.yaml | 96 ++ 10 files changed, 1205 insertions(+), 1 deletion(-) create mode 100644 electricitymap/.dockerignore rename Dockerfile => electricitymap/Dockerfile (80%) rename electricity.py => electricitymap/electricity.py (95%) create mode 100644 electricitymap/electricitymap-deploy.yaml create mode 100644 electricitymap/electricitymap-svc.yaml rename requirements.txt => electricitymap/requirements.txt (100%) create mode 100644 electricitymap/service-monitor.yaml create mode 100644 kepler/kepler-dashboard.json create mode 100644 kepler/kepler-values.yaml diff --git a/README.md b/README.md index e69de29..654daab 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,22 @@ +# Install Kepler and Electricitymap on HKB cluster. + +## Install Kepler +1 - Add Kepler helm repo +``` +helm repo add kepler https://sustainable-computing-io.github.io/kepler-helm-chart +``` +2 - Install Kepler with values.yaml +``` +cd kepler +helm install kepler kepler/kepler --namespace kepler --create-namespace --values kepler-values.yaml +``` +3 - Add Grafana Dashboard "kepler-dashboard.json" + +## Install electricitymap exporter +1 - Apply all yaml files +``` +cd electricitymap +kubectl apply -f electricitymap-deploy.yaml -n kepler +kubectl apply -f electricitymap-svc.yaml -n kepler +kubectl apply -f service-monitor.yaml -n cattle-monitoring-system +``` \ No newline at end of file diff --git a/electricitymap/.dockerignore b/electricitymap/.dockerignore new file mode 100644 index 0000000..cde523d --- /dev/null +++ b/electricitymap/.dockerignore @@ -0,0 +1,3 @@ +electricitymap-deploy.yaml +electricitymap-svc.yaml +service-monitor.yaml \ No newline at end of file diff --git a/Dockerfile b/electricitymap/Dockerfile similarity index 80% rename from Dockerfile rename to electricitymap/Dockerfile index 317d738..3a24761 100644 --- a/Dockerfile +++ b/electricitymap/Dockerfile @@ -7,4 +7,4 @@ RUN pip install --no-cache-dir -r requirements.txt COPY . . -CMD ["python", "electricity.py"] +CMD ["python", "electricity.py"] \ No newline at end of file diff --git a/electricity.py b/electricitymap/electricity.py similarity index 95% rename from electricity.py rename to electricitymap/electricity.py index 603ed25..41cd25b 100644 --- a/electricity.py +++ b/electricitymap/electricity.py @@ -42,6 +42,7 @@ class SimpleHTTPRequestHandler(BaseHTTPRequestHandler): self.send_response(200) self.end_headers() + self.send_header('Content-type', 'text/plain; version=0.0.4') response_string = f'electricitymap_carbon_intensity{{zone="{ZONE}"}} ' + str(data) self.wfile.write(response_string.encode('utf-8')) diff --git a/electricitymap/electricitymap-deploy.yaml b/electricitymap/electricitymap-deploy.yaml new file mode 100644 index 0000000..0e90f2b --- /dev/null +++ b/electricitymap/electricitymap-deploy.yaml @@ -0,0 +1,23 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: electricitymap-deployment +spec: + replicas: 1 + selector: + matchLabels: + app.kubernetes.io/component: exporter + app.kubernetes.io/name: electricitymap + template: + metadata: + labels: + app.kubernetes.io/component: exporter + app.kubernetes.io/name: electricitymap + spec: + containers: + - name: electricitymap + image: hysio-kub-repos.artifact.hysio.mutu.dc1.smhg.adm.ths/electricitymap:1.0.0 + ports: + - containerPort: 8808 + name: metrics + diff --git a/electricitymap/electricitymap-svc.yaml b/electricitymap/electricitymap-svc.yaml new file mode 100644 index 0000000..938614c --- /dev/null +++ b/electricitymap/electricitymap-svc.yaml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: Service +metadata: + name: electricitymap-service + labels: + app.kubernetes.io/component: exporter + app.kubernetes.io/name: electricitymap +spec: + selector: + app.kubernetes.io/component: exporter + app.kubernetes.io/name: electricitymap + ports: + - protocol: TCP + port: 8808 + targetPort: metrics + name: metrics \ No newline at end of file diff --git a/requirements.txt b/electricitymap/requirements.txt similarity index 100% rename from requirements.txt rename to electricitymap/requirements.txt diff --git a/electricitymap/service-monitor.yaml b/electricitymap/service-monitor.yaml new file mode 100644 index 0000000..0c0f6a7 --- /dev/null +++ b/electricitymap/service-monitor.yaml @@ -0,0 +1,19 @@ +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: electricitymap-servicemonitor +spec: + namespaceSelector: + matchNames: + - kepler + selector: + matchLabels: + app.kubernetes.io/component: exporter + app.kubernetes.io/name: electricitymap + jobLabel: app.kubernetes.io/name + endpoints: + - port: metrics + interval: 30s + path: "/" + scheme: http + scrapeTimeout: 15s \ No newline at end of file diff --git a/kepler/kepler-dashboard.json b/kepler/kepler-dashboard.json new file mode 100644 index 0000000..66c512d --- /dev/null +++ b/kepler/kepler-dashboard.json @@ -0,0 +1,1024 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "target": { + "limit": 100, + "matchAny": false, + "tags": [], + "type": "dashboard" + }, + "type": "dashboard" + } + ] + }, + "description": "Dashboard for Kepler Exporter", + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "id": 33, + "iteration": 1698153107702, + "links": [], + "panels": [ + { + "collapsed": false, + "datasource": "prometheus", + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 11, + "panels": [], + "title": "Carbon Emissions", + "type": "row" + }, + { + "datasource": null, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "percentage", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "#EAB839", + "value": 60 + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 6, + "w": 19, + "x": 2, + "y": 1 + }, + "id": 12, + "options": { + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true, + "text": {} + }, + "pluginVersion": "7.5.11", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "(\n sum by (container_namespace) (\n increase(\n kepler_container_joules_total{container_namespace=~\"$namespace\"}[24h:1m]\n )\n ) * $watt_per_second_to_kWh\n) * scalar(avg_over_time(electricitymap_carbon_intensity{zone=\"FR\"}[1h:1m]))", + "hide": false, + "interval": "", + "legendFormat": "CO2 Coal", + "range": true, + "refId": "A" + } + ], + "title": "Carbon Footprint (pounds per kWh per day) in Namespace: $namespace (PKG+DRAM+OTHER+GPU)", + "transparent": true, + "type": "gauge" + }, + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": null, + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "fill": 1, + "fillGradient": 0, + "gridPos": { + "h": 8, + "w": 12, + "x": 6, + "y": 7 + }, + "hiddenSeries": false, + "id": 19, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "nullPointMode": "null", + "options": { + "alertThreshold": true + }, + "percentage": false, + "pluginVersion": "7.5.11", + "pointradius": 2, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "stack": false, + "steppedLine": false, + "targets": [ + { + "exemplar": true, + "expr": "(\n sum by (container_namespace, pod_name) (\n increase(\n kepler_container_joules_total{container_namespace=~\"$namespace\", pod_name=~\"$pod\"}[24h:1m]\n )\n ) * $watt_per_second_to_kWh\n) * scalar(avg_over_time(electricitymap_carbon_intensity{zone=\"FR\"}[1h:1m]))", + "interval": "", + "legendFormat": "{{pod_name}} / {{container_namespace}}", + "refId": "A" + } + ], + "thresholds": [], + "timeFrom": null, + "timeRegions": [], + "timeShift": null, + "title": "Carbon Footprint (pounds per kWh per day) in Namespace: $namespace (PKG+DRAM+OTHER+GPU) and Pod : $pod", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ], + "yaxis": { + "align": false, + "alignLevel": null + } + }, + { + "collapsed": false, + "datasource": "prometheus", + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 15 + }, + "id": 8, + "panels": [], + "title": "Power Consumption", + "type": "row" + }, + { + "datasource": null, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "watt", + "axisPlacement": "left", + "barAlignment": 0, + "drawStyle": "bars", + "fillOpacity": 44, + "gradientMode": "opacity", + "hideFrom": { + "graph": false, + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 0, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "always", + "spanNulls": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": ".*DRAM.*" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "orange", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": ".*OTHER.*" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "blue", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": ".*GPU.*" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "semi-dark-green", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": ".*PKG.*" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "red", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 10, + "w": 24, + "x": 0, + "y": 16 + }, + "id": 16, + "options": { + "legend": { + "calcs": [ + "mean" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true, + "sortBy": "Mean", + "sortDesc": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + }, + "tooltipOptions": { + "mode": "single" + } + }, + "targets": [ + { + "datasource": "prometheus", + "editorMode": "code", + "expr": "sum by (pod_name, container_namespace) (irate(kepler_container_package_joules_total{container_namespace=~\"$namespace\", pod_name=~\"$pod\"}[1m]))", + "hide": false, + "interval": "", + "legendFormat": "{{pod_name}} / {{container_namespace}} / PKG", + "range": true, + "refId": "A" + }, + { + "datasource": "prometheus", + "editorMode": "code", + "expr": "sum by (pod_name, container_namespace) (irate(kepler_container_dram_joules_total{container_namespace=~\"$namespace\", pod_name=~\"$pod\"}[1m]))", + "hide": false, + "interval": "", + "legendFormat": "{{pod_name}} / {{container_namespace}} / DRAM", + "range": true, + "refId": "B" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum by (pod_name, container_namespace) (irate(kepler_container_other_joules_total{container_namespace=~\"$namespace\", pod_name=~\"$pod\"}[1m]))", + "hide": false, + "interval": "", + "legendFormat": "{{pod_name}} / {{container_namespace}} / OTHER", + "range": true, + "refId": "C" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum by (pod_name, container_namespace) (irate(kepler_container_gpu_joules_total{container_namespace=~\"$namespace\", pod_name=~\"$pod\"}[1m]))", + "hide": false, + "legendFormat": "{{pod_name}} / {{container_namespace}} / GPU", + "range": true, + "refId": "D" + } + ], + "title": "Pod/Process Power Consumption (W) in Namespace: $namespace", + "type": "timeseries" + }, + { + "datasource": null, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "watt", + "axisPlacement": "left", + "barAlignment": 0, + "drawStyle": "bars", + "fillOpacity": 44, + "gradientMode": "opacity", + "hideFrom": { + "graph": false, + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 0, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "always", + "spanNulls": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": ".*Package.*" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "red", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": ".*DRAM.*" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "orange", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": ".*OtherComponents.*" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "blue", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": ".*GPU.*" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "semi-dark-green", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 26 + }, + "id": 2, + "options": { + "legend": { + "calcs": [ + "mean", + "max" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + }, + "tooltipOptions": { + "mode": "single" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum(irate(kepler_container_package_joules_total{container_namespace=~\"$namespace\", pod_name=~\"$pod\"}[1m]))", + "hide": false, + "interval": "", + "legendFormat": "PKG", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum(irate(kepler_container_dram_joules_total{container_namespace=~\"$namespace\", pod_name=~\"$pod\"}[1m]))", + "hide": false, + "interval": "", + "legendFormat": "DRAM", + "range": true, + "refId": "B" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum(irate(kepler_container_other_joules_total{container_namespace=~\"$namespace\", pod_name=~\"$pod\"}[1m]))", + "hide": false, + "legendFormat": "OTHER", + "range": true, + "refId": "C" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum(irate(kepler_container_gpu_joules_total{container_namespace=~\"$namespace\", pod_name=~\"$pod\"}[1m]))", + "hide": false, + "legendFormat": " GPU", + "range": true, + "refId": "D" + } + ], + "title": "Total Power Consumption (W) in Namespace: $namespace", + "type": "timeseries" + }, + { + "datasource": null, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "kWh", + "axisPlacement": "left", + "barAlignment": 0, + "drawStyle": "bars", + "fillOpacity": 44, + "gradientMode": "opacity", + "hideFrom": { + "graph": false, + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 0, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "always", + "spanNulls": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": ".*Package.*" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "red", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": ".*DRAM.*" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "orange", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": ".*OtherComponents.*" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "blue", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": ".*GPU.*" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "semi-dark-green", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 26 + }, + "id": 17, + "options": { + "legend": { + "calcs": [ + "mean", + "max" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "sortBy": "Max", + "sortDesc": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + }, + "tooltipOptions": { + "mode": "single" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum (\n increase(\n (kepler_container_package_joules_total{container_namespace=~\"$namespace\", pod_name=~\"$pod\"}[24h:1m])\n )\n) * $watt_per_second_to_kWh", + "hide": false, + "interval": "", + "legendFormat": "PKG (CORE+UNCORE)", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum (\n increase(\n (kepler_container_dram_joules_total{container_namespace=~\"$namespace\", pod_name=~\"$pod\"}[24h:1m])\n )\n) * $watt_per_second_to_kWh", + "hide": false, + "interval": "", + "legendFormat": "DRAM", + "range": true, + "refId": "B" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum (\n increase(\n (kepler_container_other_joules_total{container_namespace=~\"$namespace\", pod_name=~\"$pod\"}[24h:1m])\n )\n) * $watt_per_second_to_kWh", + "hide": false, + "legendFormat": "OTHER", + "range": true, + "refId": "C" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum (\n increase(\n (kepler_container_gpu_joules_total{container_namespace=~\"$namespace\", pod_name=~\"$pod\"}[24h:1m])\n )\n) * $watt_per_second_to_kWh", + "hide": false, + "legendFormat": " GPU", + "range": true, + "refId": "D" + } + ], + "title": "Total Power Consumption (kWh per day) in Namespace: $namespace", + "type": "timeseries" + }, + { + "datasource": null, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 24, + "x": 0, + "y": 34 + }, + "id": 15, + "options": { + "displayMode": "gradient", + "minVizHeight": 10, + "minVizWidth": 0, + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showUnfilled": true, + "text": {} + }, + "pluginVersion": "7.5.11", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${datasource}" + }, + "editorMode": "code", + "expr": "sum by (container_namespace) (\n increase(\n (kepler_container_joules_total{container_namespace=~\"$namespace\", pod_name=~\"$pod\"}[24h:1m])\n )\n) * $watt_per_second_to_kWh ", + "interval": "", + "legendFormat": "{{container_namespace}}", + "range": true, + "refId": "A" + } + ], + "title": "Total Power Consumption (PKG+DRAM+OTHER+GPU) by Namespace (kWh per day)", + "type": "bargauge" + } + ], + "refresh": "", + "schemaVersion": 27, + "style": "dark", + "tags": [], + "templating": { + "list": [ + { + "current": { + "selected": false, + "text": "Prometheus", + "value": "Prometheus" + }, + "description": null, + "error": null, + "hide": 0, + "includeAll": false, + "label": null, + "multi": false, + "name": "datasource", + "options": [], + "query": "prometheus", + "queryValue": "", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "type": "datasource" + }, + { + "allValue": ".*", + "current": { + "selected": true, + "text": "calico-system", + "value": "calico-system" + }, + "datasource": null, + "definition": "label_values(kepler_container_package_joules_total, container_namespace)", + "description": "Namespace for pods to choose", + "error": null, + "hide": 0, + "includeAll": true, + "label": "Namespace", + "multi": false, + "name": "namespace", + "options": [], + "query": { + "query": "label_values(kepler_container_package_joules_total, container_namespace)", + "refId": "StandardVariableQuery" + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "allValue": ".*", + "current": { + "selected": true, + "text": "All", + "value": "$__all" + }, + "datasource": null, + "definition": "label_values(kepler_container_package_joules_total{container_namespace=~\"$namespace\"}, pod_name)", + "description": null, + "error": null, + "hide": 0, + "includeAll": true, + "label": "Pod", + "multi": false, + "name": "pod", + "options": [], + "query": { + "query": "label_values(kepler_container_package_joules_total{container_namespace=~\"$namespace\"}, pod_name)", + "refId": "StandardVariableQuery" + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "current": { + "selected": false, + "text": "2.23", + "value": "2.23" + }, + "description": null, + "error": null, + "hide": 0, + "label": "Coal Coeff", + "name": "coal", + "options": [ + { + "selected": true, + "text": "2.23", + "value": "2.23" + } + ], + "query": "2.23", + "skipUrlSync": false, + "type": "textbox" + }, + { + "current": { + "selected": false, + "text": "0.91", + "value": "0.91" + }, + "description": null, + "error": null, + "hide": 0, + "label": "Natural Gas Coeff", + "name": "natural_gas", + "options": [ + { + "selected": true, + "text": "0.91", + "value": "0.91" + } + ], + "query": "0.91", + "skipUrlSync": false, + "type": "textbox" + }, + { + "current": { + "selected": false, + "text": "2.13", + "value": "2.13" + }, + "description": null, + "error": null, + "hide": 0, + "label": "Petroleum Coeff", + "name": "petroleum", + "options": [ + { + "selected": true, + "text": "2.13", + "value": "2.13" + } + ], + "query": "2.13", + "skipUrlSync": false, + "type": "textbox" + }, + { + "description": "1W*s = 1J and 1J = (1/3600000)kWh", + "error": null, + "hide": 2, + "label": "", + "name": "watt_per_second_to_kWh", + "query": "0.000000277777777777778", + "skipUrlSync": false, + "type": "constant" + } + ] + }, + "time": { + "from": "now-15m", + "to": "now" + }, + "timepicker": {}, + "timezone": "browser", + "title": "Kepler Exporter Dashboard", + "uid": "NhnADUW4zIBM", + "version": 2 + } \ No newline at end of file diff --git a/kepler/kepler-values.yaml b/kepler/kepler-values.yaml new file mode 100644 index 0000000..ee3f619 --- /dev/null +++ b/kepler/kepler-values.yaml @@ -0,0 +1,96 @@ +--- +# -- Replaces the name of the chart in the Chart.yaml file +nameOverride: "" +# -- Replaces the generated name +fullnameOverride: "" + +image: + # -- Repository to pull the image from + repository: "quay.io/sustainable_computing_io/kepler" + # -- Image tag, if empty it will get it from the chart's appVersion + tag: "" + # -- Pull policy + pullPolicy: Always + +# -- Secret name for pulling images from private repository +imagePullSecrets: [] + +# -- Additional DaemonSet annotations +annotations: {} + +# -- Additional pod annotations +podAnnotations: {} + +# -- Additional pod labels +podLabels: {} + +# -- Privileges and access control settings for a Pod (all containers in a pod) +podSecurityContext: {} + # fsGroup: 2000 + +# -- Privileges and access control settings for a container +securityContext: + privileged: true + +# -- Node selection constraint +nodeSelector: + kubernetes.io/os: linux + node-role.kubernetes.io/worker: "true" + + +# -- Toleration for taints +tolerations: + - operator: "Exists" + +# -- Affinity rules +affinity: {} + +# -- CPU/MEM resources +resources: {} + +# -- Extra environment variables +extraEnvVars: + KEPLER_LOG_LEVEL: "1" + ENABLE_GPU: "true" + ENABLE_EBPF_CGROUPID: "true" + EXPOSE_IRQ_COUNTER_METRICS: "true" + EXPOSE_KUBELET_METRICS: "true" + ENABLE_PROCESS_METRICS: "true" + CPU_ARCH_OVERRIDE: "" + CGROUP_METRICS: "*" + # REDFISH_PROBE_INTERVAL_IN_SECONDS: "60" + # REDFISH_SKIP_SSL_VERIFY: "true" + +canMount: + usrSrc: true # /usr/src may not available, ie GKE + +service: + annotations: {} + type: ClusterIP + port: 9102 + +serviceAccount: + # Specifies whether a service account should be created + create: true + # Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + +serviceMonitor: + enabled: true + namespace: "cattle-monitoring-system" + interval: 30s + scrapeTimeout: 5s + labels: {} + +redfish: + enabled: false + name: redfish + labels: {} + annotations: {} + fileContent: |- + your_kubelet_node1_name,redfish_username,redfish_password,https://node1_redfish_ip_or_hostname + your_kubelet_node2_name,redfish_username,redfish_password,https://node2_redfish_ip_or_hostname +