@@ -38,8 +38,43 @@ const (
38
38
type VSphereClusterSpec struct {
39
39
// +optional
40
40
ControlPlaneEndpoint clusterv1.APIEndpoint `json:"controlPlaneEndpoint"`
41
+ // placement allows to configure the placement of machines of a VSphereCluster.
42
+ // +optional
43
+ Placement * VSphereClusterPlacement `json:"placement,omitempty"`
44
+ }
45
+
46
+ // VSphereClusterPlacement defines a placement strategy for machines of a VSphereCluster.
47
+ // +kubebuilder:validation:MinProperties=1
48
+ type VSphereClusterPlacement struct {
49
+ // workerAntiAffinity configures soft anti-affinity for workers.
50
+ // +optional
51
+ WorkerAntiAffinity * VSphereClusterWorkerAntiAffinity `json:"workerAntiAffinity,omitempty"`
52
+ }
53
+
54
+ // VSphereClusterWorkerAntiAffinity defines the anti-affinity configuration for workers.
55
+ // +kubebuilder:validation:MinProperties=1
56
+ type VSphereClusterWorkerAntiAffinity struct {
57
+ // mode allows to set the grouping of (soft) anti-affinity for worker nodes.
58
+ // Defaults to `Cluster`.
59
+ // +kubebuilder:validation:Enum=Cluster;None;MachineDeployment
60
+ // +optional
61
+ Mode VSphereClusterWorkerAntiAffinityMode `json:"mode,omitempty"`
41
62
}
42
63
64
+ // VSphereClusterWorkerAntiAffinityMode describes the soft anti-affinity mode used across a for distributing virtual machines.
65
+ type VSphereClusterWorkerAntiAffinityMode string
66
+
67
+ const (
68
+ // VSphereClusterWorkerAntiAffinityModeCluster means to use all workers as a single group for soft anti-affinity.
69
+ VSphereClusterWorkerAntiAffinityModeCluster VSphereClusterWorkerAntiAffinityMode = "Cluster"
70
+
71
+ // VSphereClusterWorkerAntiAffinityModeNone means to not configure any soft anti-affinity for workers.
72
+ VSphereClusterWorkerAntiAffinityModeNone VSphereClusterWorkerAntiAffinityMode = "None"
73
+
74
+ // VSphereClusterWorkerAntiAffinityModeMachineDeployment means to configure soft anti-affinity for all workers per MachineDeployment.
75
+ VSphereClusterWorkerAntiAffinityModeMachineDeployment VSphereClusterWorkerAntiAffinityMode = "MachineDeployment"
76
+ )
77
+
43
78
// VSphereClusterStatus defines the observed state of VSphereClusterSpec.
44
79
type VSphereClusterStatus struct {
45
80
// Ready indicates the infrastructure required to deploy this cluster is
0 commit comments