kubernetes-carbon-intensity-exporter
Kubernetes Carbon Intensity Exporter
https://github.com/azure/kubernetes-carbon-intensity-exporter
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (8.2%) to scientific vocabulary
Keywords
Keywords from Contributors
Repository
Kubernetes Carbon Intensity Exporter
Basic Info
Statistics
- Stars: 37
- Watchers: 63
- Forks: 10
- Open Issues: 10
- Releases: 3
Topics
Metadata Files
README.md
Kubernetes Carbon Intensity Exporter
This repo provides a data exporter by which Kubernetes operators can leverage the carbon intensity data from 3rd party for carbon-aware workload scheduling.
Installation
We provide a helm chart to help install the exporter. Note that this data exporter ONLY retrieves the carbon intensity data from WattTime OR Electricity Maps.
WattTime
You need to get the authentication ID/Password from WattTime organization before using the exporter.
```bash export WTUSERNAME=XXXX # WattTime auth info. export WTPASSWORD=YYYY export REGION=westus # The region where the AKS cluster locates.
helm del carbon-intensity-exporter helm install carbon-intensity-exporter \ --set carbonDataExporter.region=$REGION \ --set wattTime.username=$WTUSERNAME \ --set wattTime.password=$WTPASSWORD \ ./charts/carbon-intensity-exporter ```
Electricity Maps
You need to get an API token from Electricity Maps before using the exporter. You can check the name of the API token HTTP header to use and the base URL in the Electricity Maps API portal.
```bash export EMAPITOKEN=XXXX # Electricity Maps API token. export EMAPITOKENHEADER=auth-token # Electricity Maps API token HTTP header. export EMBASE_URL=https://api.electricitymap.org/v3/ export PROVIDER=ElectricityMaps export REGION=westus # The region where the AKS cluster locates.
helm del carbon-intensity-exporter helm install carbon-intensity-exporter \ --set carbonDataExporter.region=$REGION \ --set providerName=$PROVIDER \ --set electricityMaps.apiToken=$EMAPITOKEN \ --set electricityMaps.apiTokenHeader=$EMAPITOKENHEADER \ --set electricityMaps.baseURL=$EMBASE_URL \ ./charts/carbon-intensity-exporter ```
View carbon intensity data
You should be able to see one exporter Pod running in the kube-system namespace.
bash
$ kubectl get pod -n kube-system | grep carbon-intensity-exporter
$ carbon-intensity-exporter-XXXXXXX-XXXXX 2/2 Running 0 3m25s
You should also see one configmap carbon-intensity is created in the kube-system namespace.
bash
$ kubectl get configmap -n kube-system | grep carbon-intensity
$ carbon-intensity 7 3m25s
Integration
The configmap is formatted as the following:
yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: carbonintensity
namespace: kube-system
immutable: true
data:
lastHeartbeatTime: # The latest time that the data exporter controller sends the data.
message: # Additional information for user notification, if any.
numOfRecords: # The number can be any value between 0 (no records for the current location) and 24 * 12.
forecastDateTime: # The time when the raw data was generated.
minForecast: # min forecast in the data.
maxForecast: # max forecast in the data.
binarydata:
data: # json marshal of the EmissionsData array.
The EmissionData struct is defined in here. The data exporter will retrieve the 24-hour carbon intensity forecast data
from WattTime every 12 hours. Upon successful data pull, the old configmap will be deleted and a new configmap with the same name will be created.
If the data pull hits failures, the new confgimap is still created with the last seen binary data and the failure reason should be mentioned in the value
of the message key. Any Kubernetes operator can read the configmap for utilizing the carbon intensity data.
Contributing
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.
When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.
Trademarks
This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.
Owner
- Name: Microsoft Azure
- Login: Azure
- Kind: organization
- Location: United States of America
- Website: https://docs.microsoft.com/en-us/azure/
- Twitter: Azure
- Repositories: 2,270
- Profile: https://github.com/Azure
APIs, SDKs and open source projects from Microsoft Azure
GitHub Events
Total
- Create event: 1
- Release event: 1
- Issues event: 3
- Watch event: 3
- Issue comment event: 2
- Member event: 2
- Push event: 2
- Pull request review event: 2
- Pull request event: 4
- Fork event: 1
Last Year
- Create event: 1
- Release event: 1
- Issues event: 3
- Watch event: 3
- Issue comment event: 2
- Member event: 2
- Push event: 2
- Pull request review event: 2
- Pull request event: 4
- Fork event: 1
Committers
Last synced: 9 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Heba Elayoty | 3****y | 19 |
| dependabot[bot] | 4****] | 18 |
| Microsoft Open Source | m****e | 5 |
| Fei Guo | v****3@g****m | 3 |
| Ross Fairbanks | r****7 | 2 |
| Paul Yu | p****u@m****m | 2 |
| microsoft-github-operations[bot] | 5****] | 1 |
| Sertaç Özercan | 8****n | 1 |
| Chris Chinchilla | c****s@c****m | 1 |
| Batuhan Apaydın | d****n@g****m | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 9 months ago
All Time
- Total issues: 5
- Total pull requests: 65
- Average time to close issues: about 2 months
- Average time to close pull requests: 8 days
- Total issue authors: 3
- Total pull request authors: 8
- Average comments per issue: 2.0
- Average comments per pull request: 0.37
- Merged pull requests: 41
- Bot issues: 0
- Bot pull requests: 41
Past Year
- Issues: 2
- Pull requests: 4
- Average time to close issues: about 2 months
- Average time to close pull requests: about 2 months
- Issue authors: 2
- Pull request authors: 2
- Average comments per issue: 1.0
- Average comments per pull request: 0.0
- Merged pull requests: 3
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- tkennes (2)
- rossf7 (2)
- pauldotyu (1)
Pull Request Authors
- dependabot[bot] (41)
- helayoty (13)
- pauldotyu (3)
- Fei-Guo (2)
- developer-guy (2)
- ChrisChinchilla (2)
- sozercan (1)
- rossf7 (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 2
- Total downloads: unknown
- Total docker downloads: 59
-
Total dependent packages: 0
(may contain duplicates) -
Total dependent repositories: 0
(may contain duplicates) - Total versions: 6
proxy.golang.org: github.com/Azure/kubernetes-carbon-intensity-exporter
- Homepage: https://github.com/Azure/kubernetes-carbon-intensity-exporter
- Documentation: https://pkg.go.dev/github.com/Azure/kubernetes-carbon-intensity-exporter#section-documentation
- License: MIT
-
Latest release: v0.4.0
published about 1 year ago
Rankings
proxy.golang.org: github.com/azure/kubernetes-carbon-intensity-exporter
- Documentation: https://pkg.go.dev/github.com/azure/kubernetes-carbon-intensity-exporter#section-documentation
- License: mit
-
Latest release: v0.4.0
published about 1 year ago
Rankings
Dependencies
- actions/checkout 8ade135a41bc03ea155e62e844d188df1ea18608 composite
- github/codeql-action/analyze fdcae64e1484d349b3366718cdfef3d404390e85 composite
- github/codeql-action/autobuild fdcae64e1484d349b3366718cdfef3d404390e85 composite
- github/codeql-action/init fdcae64e1484d349b3366718cdfef3d404390e85 composite
- actions/checkout 8ade135a41bc03ea155e62e844d188df1ea18608 composite
- docker/build-push-action 0565240e2d4ab88bba5387d719585280857ece09 composite
- docker/login-action 343f7c4344506bcbf9b4de18042ae17996df046d composite
- docker/setup-buildx-action f95db51fddba0c2d1ec667646a06c2ce06100226 composite
- actions/checkout 8ade135a41bc03ea155e62e844d188df1ea18608 composite
- actions/setup-go v4 composite
- gcr.io/distroless/static nonroot build
- golang 1.19 build
- mcr.microsoft.com/dotnet/aspnet 6.0 build
- mcr.microsoft.com/dotnet/sdk 6.0 build
- github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1
- github.com/NYTimes/gziphandler v1.1.1
- github.com/antihax/optional v1.0.0
- github.com/antlr/antlr4/runtime/Go/antlr v1.4.10
- github.com/beorn7/perks v1.0.1
- github.com/blang/semver/v4 v4.0.0
- github.com/cenkalti/backoff/v4 v4.1.3
- github.com/cespare/xxhash/v2 v2.2.0
- github.com/coreos/go-semver v0.3.0
- github.com/coreos/go-systemd/v22 v22.3.2
- github.com/davecgh/go-spew v1.1.1
- github.com/emicklei/go-restful/v3 v3.9.0
- github.com/evanphx/json-patch v4.12.0+incompatible
- github.com/felixge/httpsnoop v1.0.3
- github.com/fsnotify/fsnotify v1.6.0
- github.com/go-logr/logr v1.2.3
- github.com/go-logr/stdr v1.2.2
- github.com/go-openapi/jsonpointer v0.19.5
- github.com/go-openapi/jsonreference v0.20.0
- github.com/go-openapi/swag v0.19.14
- github.com/gogo/protobuf v1.3.2
- github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da
- github.com/golang/protobuf v1.5.2
- github.com/google/cel-go v0.12.6
- github.com/google/gnostic v0.5.7-v3refs
- github.com/google/go-cmp v0.5.9
- github.com/google/gofuzz v1.1.0
- github.com/google/uuid v1.3.0
- github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0
- github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0
- github.com/imdario/mergo v0.3.6
- github.com/inconshreveable/mousetrap v1.0.1
- github.com/josharian/intern v1.0.0
- github.com/json-iterator/go v1.1.12
- github.com/mailru/easyjson v0.7.6
- github.com/matttproud/golang_protobuf_extensions v1.0.2
- github.com/moby/term v0.0.0-20220808134915-39b0c02b01ae
- github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd
- github.com/modern-go/reflect2 v1.0.2
- github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822
- github.com/pkg/errors v0.9.1
- github.com/prometheus/client_golang v1.14.0
- github.com/prometheus/client_model v0.3.0
- github.com/prometheus/common v0.37.0
- github.com/prometheus/procfs v0.8.0
- github.com/spf13/cobra v1.6.0
- github.com/spf13/pflag v1.0.5
- github.com/stoewer/go-strcase v1.2.0
- go.etcd.io/etcd/api/v3 v3.5.5
- go.etcd.io/etcd/client/pkg/v3 v3.5.5
- go.etcd.io/etcd/client/v3 v3.5.5
- go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.35.0
- go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.35.0
- go.opentelemetry.io/otel v1.10.0
- go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.10.0
- go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.10.0
- go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.10.0
- go.opentelemetry.io/otel/metric v0.31.0
- go.opentelemetry.io/otel/sdk v1.10.0
- go.opentelemetry.io/otel/trace v1.10.0
- go.opentelemetry.io/proto/otlp v0.19.0
- go.uber.org/atomic v1.7.0
- go.uber.org/multierr v1.6.0
- go.uber.org/zap v1.19.0
- golang.org/x/net v0.7.0
- golang.org/x/oauth2 v0.4.0
- golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4
- golang.org/x/sys v0.5.0
- golang.org/x/term v0.5.0
- golang.org/x/text v0.7.0
- golang.org/x/time v0.0.0-20220210224613-90d013bbcef8
- google.golang.org/appengine v1.6.7
- google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f
- google.golang.org/grpc v1.53.0
- google.golang.org/protobuf v1.28.1
- gopkg.in/inf.v0 v0.9.1
- gopkg.in/yaml.v2 v2.4.0
- gopkg.in/yaml.v3 v3.0.1
- k8s.io/api v0.26.2
- k8s.io/apimachinery v0.26.2
- k8s.io/apiserver v0.26.2
- k8s.io/client-go v0.26.2
- k8s.io/component-base v0.26.2
- k8s.io/klog/v2 v2.80.1
- k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280
- k8s.io/utils v0.0.0-20221107191617-1a15be271d1d
- sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.35
- sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2
- sigs.k8s.io/structured-merge-diff/v4 v4.2.3
- sigs.k8s.io/yaml v1.3.0
- 651 dependencies