- Go 86.2%
- Shell 10%
- Makefile 1.9%
- Go Template 1.1%
- Dockerfile 0.8%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
predictionfilter/predictionscore called cache.WaitForCacheSync with a never-closed stopCh, so a missing ClusterPredictionState CRD, RBAC denial, or unreachable Karmada API blocked scheduler startup forever. Mirror the carbon plugin's 10s timeout context so init fails fast instead of hanging. |
||
| .forgejo/workflows | ||
| chart | ||
| cmd/scheduler | ||
| deploy/argocd | ||
| docs | ||
| pkg | ||
| test/showcase | ||
| .gitignore | ||
| .goreleaser.yaml | ||
| CHANGELOG.md | ||
| CITATION.cff | ||
| CODE_OF_CONDUCT.md | ||
| CODEOWNERS | ||
| CONTRIBUTING.md | ||
| Dockerfile | ||
| Dockerfile.goreleaser | ||
| Dockerfile.local | ||
| EU-DISCLAIMER.md | ||
| go.mod | ||
| go.sum | ||
| LICENSE-CODE | ||
| LICENSE-DOCS | ||
| Makefile | ||
| NOTICE | ||
| PSA-REMEDIATION.md | ||
| README.md | ||
| renovate.json | ||
| SECURITY.md | ||
| THIRD-PARTY-NOTICES.md | ||
| VERSION | ||
Karmada Scheduler Edge Connect
Combined Karmada scheduler that replaces the stock karmada-scheduler with three
additional plugins compiled in:
| Plugin | Type | Source | What it does |
|---|---|---|---|
| CarbonScore | Filter + Score | karmada-carbon-scheduler | Filters/scores clusters by carbon intensity and renewable energy share via ClusterCarbonMetrics CRD |
| PredictionFilter | Filter | karmada-prediction-scheduler | Hard-rejects clusters with catastrophic predicted pressure (>95%) or extreme hotspots |
| PredictionScore | Score | karmada-prediction-scheduler | Ranks clusters by predicted future capacity with optional estimator fusion |
All stock Karmada scheduler plugins remain active — these three are additive.
Full documentation lives under
docs/. Start withdocs/dependencies.mdfor what each plugin needs to actually do useful work (CRDs, collectors, prediction pipeline), thendocs/getting-started/quickstart.mdfor installation anddocs/how-to/enable-plugins-staged.mdfor the safe rollout sequence.
Why?
Karmada does not support chaining multiple scheduler binaries. A ResourceBinding is
handled by exactly one scheduler. Running carbon and prediction as separate schedulers
means workloads get one or the other, never both.
This repo compiles all plugins into a single binary that replaces the stock
karmada-scheduler deployment so every workload benefits from all scheduling signals.
Architecture
┌─────────────────────────────────────────────────────┐
│ karmada-scheduler-edge-connect │
│ │
│ ┌─────────────┐ ┌──────────────────┐ │
│ │ Filter phase │ │ Score phase │ │
│ │ │ │ │ │
│ │ • built-ins │ │ • built-ins │ │
│ │ • CarbonScore│ │ • CarbonScore │ │
│ │ • Prediction │ │ • PredictionScore│ │
│ │ Filter │ │ │ │
│ └──────┬───────┘ └────────┬─────────┘ │
│ │ AND │ SUM │
│ ▼ ▼ │
│ candidates ranked list │
└─────────────────────────────────────────────────────┘
▲ ▲
│ │
ClusterCarbonMetrics ClusterPredictionState
(carbon-data-collector) (prediction-service)
Prerequisites
Both CRDs must be installed in the Karmada control plane:
ClusterCarbonMetrics(API groupcarbon.edge-connect.eu)ClusterPredictionState(API groupprediction.edge-connect.eu)
The plugins degrade gracefully if their CRDs are absent — they log a warning and allow all clusters through (fail-open).
Development
# Build locally
make build-local
# Run tests
make test
# Build Docker image (run from repo root — Dockerfile uses sibling dirs)
make docker-build
The module is self-contained: the carbon (pkg/apis/carbon) and prediction
(pkg/apis/prediction) API types are vendored in-tree, so no replace
directives or sibling checkouts are required.
Deployment
helm install karmada-scheduler chart/ \
--namespace karmada-system \
--set image.repository=<registry>/karmada-scheduler-edge-connect \
--set image.tag=v0.1.0 \
--set kubeconfig.existingSecret=karmada-kubeconfig
This deployment replaces the stock karmada-scheduler. Delete or scale down the
original deployment first.
Configuration
CarbonScore plugin (env vars)
| Variable | Default | Description |
|---|---|---|
CARBON_WEIGHT |
0.7 |
Weight for carbon intensity in score calculation |
RENEWABLE_WEIGHT |
0.3 |
Weight for renewable share in score calculation |
MAX_CARBON_INTENSITY |
200 |
Max gCO₂/kWh threshold for filter (0=disabled) |
MIN_RENEWABLE_SHARE |
0.0 |
Min renewable % threshold for filter (0=disabled) |
PredictionScore plugin (env vars)
| Variable | Default | Description |
|---|---|---|
PREDICTION_SCORE_MODE |
prediction_only |
prediction_only or estimator_fusion |
PREDICTION_SCORE_WEIGHT |
30 |
Weight for prediction score |
PREDICTION_HORIZON |
10m |
Prediction horizon (10m, 30m, 60m) |
PREDICTION_ESTIMATOR_TIMEOUT |
500ms |
RPC timeout for estimator calls |
Scheduler flags
| Flag | Default | Description |
|---|---|---|
--plugins |
*,CarbonScore,PredictionFilter,PredictionScore |
Enable all defaults + custom plugins |
--enable-scheduler-estimator |
true |
Enable Karmada scheduler estimator |
--leader-elect |
true |
HA leader election |
Publication note
This repository is published as a result of the EU-funded project DTAG Beitrag zur Entwicklung eines Multi-Provider Edge-Cloud-Kontinuums (Deutsche Telekom IPCEI-CIS), part of the 8ra initiative. It is provided for publication and dissemination purposes and is effectively read-only: external contributions, pull requests, and issue-based collaboration are not accepted unless explicitly requested by the project consortium. See CONTRIBUTING.md and SECURITY.md.
License
Unless stated otherwise:
- Source code is licensed under the Apache License 2.0 — see LICENSE-CODE.
- Documentation and other textual materials are licensed under the Creative Commons Attribution 4.0 International License (CC BY 4.0) — see LICENSE-DOCS.
Attribution and consortium information are recorded in NOTICE. Third-party components are documented in THIRD-PARTY-NOTICES.md.
EU funding notice and disclaimer
Funded by the European Union – NextGenerationEU under Grant Agreement No. 13IPC005.
The views and opinions expressed are solely those of the author(s) and do not necessarily reflect the views of the European Union or the European Commission. Neither the European Union nor the European Commission can be held responsible for them.
See EU-DISCLAIMER.md.