Skip to content

Commit

Permalink
Update MachinePool
Browse files Browse the repository at this point in the history
  • Loading branch information
eliorerz committed Feb 17, 2025
1 parent cdcb035 commit 3584490
Show file tree
Hide file tree
Showing 12 changed files with 1,860 additions and 225 deletions.
45 changes: 10 additions & 35 deletions apis/hive/v1/nutanix/machinepools.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package nutanix

import (
machinev1 "github.com/openshift/api/machine/v1"
"k8s.io/apimachinery/pkg/api/resource"
)

// MachinePool stores the configuration for a machine pool installed
Expand Down Expand Up @@ -51,19 +50,16 @@ type MachinePool struct {
// +optional
Categories []machinev1.NutanixCategory `json:"categories,omitempty"`

//// GPUs is a list of GPU devices to attach to the machine's VM.
//// +listType=set
//// +kubebuilder:validation:X-KubernetesListType=set
//// +kubebuilder:validation:X-KubernetesMapType=atomic
//// +optional
//GPUs []machinev1.NutanixGPU `json:"gpus,omitempty"`
//
//// DataDisks holds information of the data disks to attach to the Machine's VM
//// +listType=set
//// +kubebuilder:validation:X-KubernetesListType=set
//// +kubebuilder:validation:X-KubernetesMapType=atomic
//// +optional
//DataDisks []DataDisk `json:"dataDisks,omitempty"`
// GPUs is a list of GPU devices to attach to the machine's VM.
// +kubebuilder:validation:X-KubernetesListType=set
// +kubebuilder:validation:X-KubernetesMapType=atomic
// +optional
GPUs []machinev1.NutanixGPU `json:"gpus,omitempty"`

// DataDisks holds information of the data disks to attach to the Machine's VM
// +kubebuilder:validation:X-KubernetesListType=set
// +optional
DataDisks []machinev1.NutanixVMDisk `json:"dataDisks,omitempty"`

// FailureDomains optionally configures a list of failure domain names
// that will be applied to the MachinePool
Expand Down Expand Up @@ -92,24 +88,3 @@ type StorageConfig struct {
// +optional
StorageContainer *StorageResourceReference `json:"storageContainer,omitempty"`
}

// DataDisk defines a data disk for a Machine VM.
type DataDisk struct {
// diskSize is size (in Quantity format) of the disk to attach to the VM.
// See https://pkg.go.dev/k8s.io/apimachinery/pkg/api/resource#Format for the Quantity format and example documentation.
// The minimum diskSize is 1GB.
// +kubebuilder:validation:Required
DiskSize resource.Quantity `json:"diskSize"`

// deviceProperties are the properties of the disk device.
// +optional
DeviceProperties *machinev1.NutanixVMDiskDeviceProperties `json:"deviceProperties,omitempty"`

// storageConfig are the storage configuration parameters of the VM disks.
// +optional
StorageConfig *StorageConfig `json:"storageConfig,omitempty"`

// dataSource refers to a data source image for the VM disk.
// +optional
DataSourceImage *StorageResourceReference `json:"dataSourceImage,omitempty"`
}
14 changes: 13 additions & 1 deletion apis/hive/v1/nutanix/platform.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package nutanix

import corev1 "k8s.io/api/core/v1"
import (
configv1 "github.com/openshift/api/config/v1"
corev1 "k8s.io/api/core/v1"
)

// CredentialsSecretName is the default nutanix credentials secret name.
//
Expand Down Expand Up @@ -40,6 +43,15 @@ type Platform struct {
// SubnetUUIDs identifies the network subnets to be used by the cluster.
// Currently, we only support one subnet for an OpenShift cluster.
SubnetUUIDs []string `json:"subnetUUIDs"`

// LoadBalancer defines how the load balancer used by the cluster is configured.
// LoadBalancer is available in TechPreview.
// +optional
LoadBalancer *configv1.NutanixPlatformLoadBalancer `json:"loadBalancer,omitempty"`

// FailureDomains configures failure domains for the Nutanix platform.
// +optional
FailureDomains []FailureDomain `json:"failureDomains,omitempty"`
}

// PrismCentral holds the endpoint and credentials data used to connect to the Prism Central
Expand Down
59 changes: 27 additions & 32 deletions apis/hive/v1/nutanix/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 3584490

Please sign in to comment.