Closed fishingfly closed 2 months ago
We've encountered the same issue (by accident). Just wondering if this is by design or if it needs to be fixed.
Hey @yeahdongcn @fishingfly ! Thanks for reporting this issue and sorry for the late respone! That is actually expected behaviour for the default configuration as nodes shouldn't be changed within the vCluster as that would break isolation. There are however 2 ways that should achieve what you want to do:
controlPlane.advanced.virtualScheduler.enabled=true
(https://vcluster.com/docs/vcluster/configure/vcluster-yaml/control-plane/other/advanced/virtual-scheduler), which has the advantage that cordoning a node within the virtual cluster won't mark it unschedulable in the host cluster, so pods on the host are unaffected by this and only virtual pods will not be scheduled.sync.fromHost.nodes.syncBackChanges=true
(https://vcluster.com/docs/vcluster/next/configure/vcluster-yaml/sync/from-host/nodes#sync-real-nodes-and-sync-back-labels-and-taints), which will sync taints and labels to the host cluster. This means that if you cordon a node within the virtual cluster it will get unschedulable for everyone including pods on the host cluster.Thank you for the detailed explanation. Option 1 seems like the better choice for us since it won’t impact the host cluster.
What happened?
When I use this command to cordon node in k8s cluster which created by vCluster.
the status of node is as follows:
What did you expect to happen?
Node can be cordoned in cluster
How can we reproduce it (as minimally and precisely as possible)?
In virtual cluster, use this command to cordon node:
At the same time, you need to watch node status by this command:
Anything else we need to know?
I see the code https://github.com/loft-sh/vcluster/blob/v0.19.6/pkg/controllers/resources/nodes/translate.go#L25,
translateUpdateBackwards
func will update virtual node spec by host node spec.Host cluster Kubernetes version
vcluster version
0.19.6
VCluster Config