Skip to content

New flag for VirtualKubernetesCluster controller: --node-selector-label #249

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

squaremo
Copy link
Contributor

When creating VirtualKubernetesClusters especially, it will sometimes be useful to limit the nodes used by the vCluster, with a node selector. The setting fromHost.nodes.selector.labels both limits which nodes appear from inside the vcluster, and which nodes pods can be scheduled on.

I've represented this as a flag --node-selector-label -- label because the value is going to be particular to the vcluster. It has a counterpart in the Helm chart values.yaml.

When creating VirtualKubernetesClusters especially, it will sometimes
be useful to limit the nodes used by the vCluster, with a node
selector. The setting `fromHost.nodes.selector.labels` both limits
which nodes appear from inside the vcluster, and which nodes pods can
be scheduled on.

I've represented this as a flag `--node-selector-label` -- label
because the _value_ is going to be particular to the vcluster. It has
a counterpart in the Helm chart values.yaml.
@squaremo squaremo force-pushed the vkc-node-selector branch from 95abc24 to 6997617 Compare May 19, 2025 13:23
@@ -135,7 +134,8 @@ func (o *Options) AddFlags(f *pflag.FlagSet) {
o.regionOptions.AddFlags(f)
o.clientOptions.AddFlags(f)

f.StringVar(&o.domain, "virtual-kubernetes-cluster-domain", "virtual-kubernetes.example.com", "DNS domain for vclusters to be hosts of.")
f.StringVar(&o.provisionerOptions.Domain, "virtual-kubernetes-cluster-domain", "virtual-kubernetes.example.com", "DNS domain for vclusters to be hosts of.")
f.StringVar(&o.provisionerOptions.NodeSelectorLabel, "node-selector-label", "", "Label to use for vCluster node selectors (with the value of the vcluster name).")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
f.StringVar(&o.provisionerOptions.NodeSelectorLabel, "node-selector-label", "", "Label to use for vCluster node selectors (with the value of the vcluster name).")
f.StringVar(&o.provisionerOptions.NodeSelectorLabel, "node-selector-label", "", "Label to use for vCluster node selectors (will be given the value of the vcluster name, in the selector).")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant