Skip to content

Commit

Permalink
Add Vsphere failure domain API changes (#9223)
Browse files Browse the repository at this point in the history
* Add vsphere failure domains api changes

* Add vsphere failure domain manifests

* Fix lint formatting

* Move failure domain validation to types
  • Loading branch information
rajeshvenkata authored Feb 7, 2025
1 parent 6e257cf commit f0fc3fa
Show file tree
Hide file tree
Showing 8 changed files with 559 additions and 8 deletions.
6 changes: 6 additions & 0 deletions config/crd/bases/anywhere.eks.amazonaws.com_clusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,12 @@ spec:
description: Count defines the number of desired worker nodes.
Defaults to 1.
type: integer
failureDomains:
description: FailureDomains is the optional list of failure
domains to distribute worker nodes across the infrastructure.
items:
type: string
type: array
kubeletConfiguration:
description: KubeletConfiguration is a struct that exposes the
Kubelet settings for the user to set on worker nodes.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,44 @@ spec:
properties:
datacenter:
type: string
failureDomains:
items:
description: FailureDomain defines the list of failure domains to
spread the VMs across.
properties:
computeCluster:
description: ComputeCluster is the name or inventory path of
the computecluster in which the VM is created/located
type: string
datastore:
description: Datastore is the name or inventory path of the
datastore in which the VM is created/located
type: string
folder:
description: Folder is the name or inventory path of the folder
in which the the VM is created/located
type: string
name:
description: Name is used as a unique identifier for each failure
domain.
type: string
network:
description: Network is the name or inventory path of the network
which will be added to the VM
type: string
resourcePool:
description: ResourcePool is the name or inventory path of the
resource pool in which the VM is created/located
type: string
required:
- computeCluster
- datastore
- folder
- name
- network
- resourcePool
type: object
type: array
insecure:
type: boolean
network:
Expand Down
55 changes: 53 additions & 2 deletions config/manifest/eksa-components.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2752,8 +2752,13 @@ spec:
- arm
type: object
iso:
description: HookArch defines the Tinkerbell hook
architecture-specific artifacts.
properties:
amd:
description: Archive represents an archive asset
(e.g. tarball) along with its OS/architecture
metadata, and checksums for file integrity.
properties:
arch:
description: Architectures of the asset
Expand Down Expand Up @@ -2790,6 +2795,9 @@ spec:
type: string
type: object
arm:
description: Archive represents an archive asset
(e.g. tarball) along with its OS/architecture
metadata, and checksums for file integrity.
properties:
arch:
description: Architectures of the asset
Expand Down Expand Up @@ -3534,7 +3542,6 @@ spec:
- docker
- eksD
- eksa
- endOfStandardSupport
- etcdadmBootstrap
- etcdadmController
- flux
Expand Down Expand Up @@ -4550,6 +4557,12 @@ spec:
description: Count defines the number of desired worker nodes.
Defaults to 1.
type: integer
failureDomains:
description: FailureDomains is the optional list of failure
domains to distribute worker nodes across the infrastructure.
items:
type: string
type: array
kubeletConfiguration:
description: KubeletConfiguration is a struct that exposes the
Kubelet settings for the user to set on worker nodes.
Expand Down Expand Up @@ -7457,6 +7470,44 @@ spec:
properties:
datacenter:
type: string
failureDomains:
items:
description: FailureDomain defines the list of failure domains to
spread the VMs across.
properties:
computeCluster:
description: ComputeCluster is the name or inventory path of
the computecluster in which the VM is created/located
type: string
datastore:
description: Datastore is the name or inventory path of the
datastore in which the VM is created/located
type: string
folder:
description: Folder is the name or inventory path of the folder
in which the the VM is created/located
type: string
name:
description: Name is used as a unique identifier for each failure
domain.
type: string
network:
description: Network is the name or inventory path of the network
which will be added to the VM
type: string
resourcePool:
description: ResourcePool is the name or inventory path of the
resource pool in which the VM is created/located
type: string
required:
- computeCluster
- datastore
- folder
- name
- network
- resourcePool
type: object
type: array
insecure:
type: boolean
network:
Expand Down Expand Up @@ -8988,4 +9039,4 @@ webhooks:
- UPDATE
resources:
- vspheremachineconfigs
sideEffects: None
sideEffects: None
2 changes: 2 additions & 0 deletions pkg/api/v1alpha1/cluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,8 @@ type WorkerNodeGroupConfiguration struct {
// KubeletConfiguration is a struct that exposes the Kubelet settings for the user to set on worker nodes.
// +kubebuilder:pruning:PreserveUnknownFields
KubeletConfiguration *unstructured.Unstructured `json:"kubeletConfiguration,omitempty"`
// FailureDomains is the optional list of failure domains to distribute worker nodes across the infrastructure.
FailureDomains []string `json:"failureDomains,omitempty"`
}

// Equal compares two WorkerNodeGroupConfigurations.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
apiVersion: anywhere.eks.amazonaws.com/v1alpha1
kind: Cluster
metadata:
name: eksa-unit-test
spec:
controlPlaneConfiguration:
count: 3
endpoint:
host: test-ip
machineGroupRef:
name: eksa-unit-test
kind: VSphereMachineConfig
kubernetesVersion: 1.20
workerNodeGroupConfigurations:
- count: 3
machineGroupRef:
name: eksa-unit-test
kind: VSphereMachineConfig
name: "md-0"
datacenterRef:
kind: VSphereDatacenterConfig
name: eksa-unit-test
clusterNetwork:
cni: "cilium"
pods:
cidrBlocks:
- 192.168.0.0/16
services:
cidrBlocks:
- 10.96.0.0/12
---
apiVersion: anywhere.eks.amazonaws.com/v1alpha1
kind: VSphereMachineConfig
metadata:
name: eksa-unit-test
spec:
diskGiB: 25
datastore: "myDatastore"
folder: "myFolder"
memoryMiB: 8192
numCPUs: 2
osFamily: "ubuntu"
resourcePool: "myResourcePool"
storagePolicyName: "myStoragePolicyName"
template: "myTemplate"
users:
- name: "mySshUsername"
sshAuthorizedKeys:
- "mySshAuthorizedKey"
---
apiVersion: anywhere.eks.amazonaws.com/v1alpha1
kind: VSphereDatacenterConfig
metadata:
name: eksa-unit-test
spec:
datacenter: "myDatacenter"
network: "myNetwork"
server: "myServer"
thumbprint: "myTlsThumbprint"
insecure: false
failureDomains:
- name: "fd-1"
computeCluster: "myComputeCluster"
resourcePool: "myResourcePool"
datastore: "myDatastore"
folder: "myFolder"
network: "/myDatacenter/network/myNetwork"
Loading

0 comments on commit f0fc3fa

Please sign in to comment.