Create the complete weight-controller infrastructure: Go module, controller skeleton, deployment manifests. The controller watches ExternalModel resources and logs reconciliation events.
What's Included:
- Go module structure (
weight-controller/)
- Import ODH Payload Processing types (
ExternalModel, ExternalProvider)
- Controller-runtime based controller that watches
ExternalModel
- Logs when ExternalModel is created/updated/deleted
- RBAC manifests (ServiceAccount, ClusterRole, ClusterRoleBinding)
- Deployment manifests (Deployment, Service)
- Dockerfile (multi-stage, distroless base)
- Makefile with
build, test, lint, docker-build targets
Directory Structure:
# Go module (follows maas-controller pattern)
weight-controller/
├── go.mod
├── go.sum
├── Makefile
├── Dockerfile
├── cmd/
│ └── main.go
└── pkg/
├── controller/
│ └── weight/
│ ├── controller.go # Main reconciliation loop
│ └── calculator.go # Weight calculation algorithm
│
├── metrics/
│ ├── types.go # ClusterMetrics struct
│ ├── source.go # ClusterMetricsSource interface
│ │
│ ├── vllm/ # VRAM utilization (from vLLM)
│ │ └── scraper.go # vLLM Prometheus scraper (:8000)
│ │
│ └── epp/ # Latency (from llm-d EPP)
│ └── scraper.go # EPP Prometheus scraper (:9090)
│
├── health/
│ └── tracker.go # Cluster health state tracking
│
└── config/
└── config.go # ConfigMap-based configuration
# Deployment manifests (centralized, follows repo pattern)
deployment/base/weight-controller/
├── default/
│ └── kustomization.yaml # ties everything together
├── rbac/
│ ├── kustomization.yaml
│ ├── serviceaccount.yaml
│ ├── clusterrole.yaml
│ └── clusterrolebinding.yaml
├── manager/
│ ├── kustomization.yaml
│ └── deployment.yaml
└── monitoring/
├── kustomization.yaml
└── service.yaml
# Sample CRs
docs/samples/weight-controller/
└── externalmodel-multi-cluster.yaml
Architecture:
vllm/scraper.go epp/scraper.go
(VRAM utilization) (Latency)
│ │
└───────────┬───────────────┘
│
▼
ClusterMetrics
│
▼
controller/weight/
calculator.go
│
▼
Patch ExternalModel
Acceptance Criteria:
Demo:
# Deploy controller
kubectl apply -k deployment/base/weight-controller/default/
# Create an ExternalModel with multiple providers
kubectl apply -f docs/samples/weight-controller/externalmodel-multi-cluster.yaml
# See controller logs
kubectl logs -l app=weight-controller -n maas-system
# Output: "Reconciling ExternalModel: my-model"
Create the complete weight-controller infrastructure: Go module, controller skeleton, deployment manifests. The controller watches
ExternalModelresources and logs reconciliation events.What's Included:
weight-controller/)ExternalModel,ExternalProvider)ExternalModelbuild,test,lint,docker-buildtargetsDirectory Structure:
Architecture:
Acceptance Criteria:
make -C weight-controller buildsucceedsmake -C weight-controller docker-buildcreates image < 100MBkubectl apply -k deployment/base/weight-controller/default/deploys successfullyDemo: