- Go 95.8%
- Makefile 2.1%
- Smarty 1.2%
- Dockerfile 0.9%
|
All checks were successful
ci-main / test (push) Successful in 4m21s
Reviewed-on: #1 |
||
|---|---|---|
| .forgejo/workflows | ||
| chart | ||
| cmd/scheduler | ||
| docs | ||
| pkg | ||
| .gitignore | ||
| .goreleaser.yaml | ||
| Dockerfile | ||
| Dockerfile.goreleaser | ||
| go.mod | ||
| go.sum | ||
| Makefile | ||
| README.md | ||
| renovate.json | ||
| 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 go.mod uses replace directives pointing to sibling directories:
replace (
github.com/telekom-8ra/karmada-carbon-scheduler => ../karmada-carbon-scheduler
karmada-prediction-scheduler => ../karmada-prediction-scheduler
)
Ensure both repos are checked out alongside this one under ../.
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 |
License
Apache-2.0 — Copyright 2026 Deutsche Telekom AG / IPCEI-CIS