This plugin is intended to make vCluster work correctly with github.com/kroderdev/vnode.
When a pod inside vCluster is assigned to a vnode, its spec.nodeName points to a virtual node name like vnode-*.
That node name does not exist as a real schedulable host node, so sending it unchanged to the host cluster causes problems.
This plugin fixes that by:
- clearing vnode-based
spec.nodeNamebefore the host pod is created - storing the original vnode name in
vnode.kroderdev.io/node-name - restoring that vnode name when the host pod is read back into vCluster
This allows the host cluster to schedule onto a real node while vCluster still sees the pod as bound to the vnode.
For pods with spec.nodeName starting with vnode-:
- on create: move the node name into a label and clear
spec.nodeName - on get: restore
spec.nodeNamefrom the label
Pods without a vnode-style node name are left unchanged.
Run tests:
go test ./... -v -coverprofile=coverage.out -covermode=atomicBuild:
go build -o bin/Build image:
docker build -t ghcr.io/kroderdev/vcluster-vnode-plugin:dev -f Dockerfile .