Skip to content

Commit

Permalink
vSphere - add host and vm based zonal
Browse files Browse the repository at this point in the history
  • Loading branch information
jcpowermac committed Aug 14, 2024
1 parent e48b223 commit 3ea73d9
Show file tree
Hide file tree
Showing 41 changed files with 5,070 additions and 1 deletion.
34 changes: 34 additions & 0 deletions config/v1/types_infrastructure.go
Original file line number Diff line number Diff line change
Expand Up @@ -1147,6 +1147,17 @@ type VSpherePlatformLoadBalancer struct {
Type PlatformLoadBalancerType `json:"type,omitempty"`
}

type VSphereFailureDomainType string

const (
// HostGroupFailureDomain is a failure domain for a host group.
HostGroupFailureDomain VSphereFailureDomainType = "HostGroup"
// ComputeClusterFailureDomain is a failure domain for a compute cluster.
ComputeClusterFailureDomain VSphereFailureDomainType = "ComputeCluster"
// DatacenterFailureDomain is a failure domain for a datacenter.
DatacenterFailureDomain VSphereFailureDomainType = "Datacenter"
)

// VSpherePlatformFailureDomainSpec holds the region and zone failure domain and
// the vCenter topology of that failure domain.
type VSpherePlatformFailureDomainSpec struct {
Expand All @@ -1165,6 +1176,10 @@ type VSpherePlatformFailureDomainSpec struct {
// +kubebuilder:validation:Required
Region string `json:"region"`

// +kubebuilder:validation:Optional
// +openshift:validation:FeatureGateAwareEnum:featureGate=VSphereHostVMGroupZonal,enum="";HostGroup;ComputeCluster;Datacenter
RegionType string `json:"regionType"`

// zone defines the name of a zone tag that will
// be attached to a vCenter cluster. The tag
// category in vCenter must be named openshift-zone.
Expand All @@ -1173,6 +1188,13 @@ type VSpherePlatformFailureDomainSpec struct {
// +kubebuilder:validation:Required
Zone string `json:"zone"`

// zone defines the name of a zone tag that will
// be attached to a vCenter cluster. The tag
// category in vCenter must be named openshift-zone.
// +kubebuilder:validation:Optional
// +openshift:validation:FeatureGateAwareEnum:featureGate=VSphereHostVMGroupZonal,enum="";HostGroup;ComputeCluster;Datacenter
ZoneType string `json:"zoneType"`

// server is the fully-qualified domain name or the IP address of the vCenter server.
// +kubebuilder:validation:Required
// +kubebuilder:validation:MinLength=1
Expand Down Expand Up @@ -1257,6 +1279,18 @@ type VSpherePlatformTopology struct {
// +kubebuilder:validation:Pattern=`^/.*?/vm/.*?`
// +optional
Template string `json:"template,omitempty"`

// +optional
// +openshift:validation:featureGate=VSphereHostVMGroupZonal
AffinityGroup VSphereFailureDomainAffinityGroup `json:"affinityGroup,omitempty"`
}

type VSphereFailureDomainAffinityGroup struct {
// VMGroupName is the name of the VM group
VMGroupName string `json:"vmGroupName"`

// HostGroupName is the name of the Host group
HostGroupName string `json:"hostGroupName"`
}

// VSpherePlatformVCenterSpec stores the vCenter connection fields.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,13 @@ spec:
maxLength: 80
minLength: 1
type: string
regionType:
enum:
- ""
- HostGroup
- ComputeCluster
- Datacenter
type: string
server:
anyOf:
- format: ipv4
Expand All @@ -642,6 +649,17 @@ spec:
description: Topology describes a given failure domain
using vSphere constructs
properties:
affinityGroup:
properties:
hostGroupName:
description: HostGroupName is the name of the
Host group
type: string
vmGroupName:
description: VMGroupName is the name of the
VM group
type: string
type: object
computeCluster:
description: computeCluster the absolute path of
the vCenter cluster in which virtual machine will
Expand Down Expand Up @@ -723,6 +741,16 @@ spec:
maxLength: 80
minLength: 1
type: string
zoneType:
description: zone defines the name of a zone tag that
will be attached to a vCenter cluster. The tag category
in vCenter must be named openshift-zone.
enum:
- ""
- HostGroup
- ComputeCluster
- Datacenter
type: string
required:
- name
- region
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,8 @@ spec:
maxLength: 80
minLength: 1
type: string
regionType:
type: string
server:
anyOf:
- format: ipv4
Expand All @@ -642,6 +644,17 @@ spec:
description: Topology describes a given failure domain
using vSphere constructs
properties:
affinityGroup:
properties:
hostGroupName:
description: HostGroupName is the name of the
Host group
type: string
vmGroupName:
description: VMGroupName is the name of the
VM group
type: string
type: object
computeCluster:
description: computeCluster the absolute path of
the vCenter cluster in which virtual machine will
Expand Down Expand Up @@ -723,6 +736,11 @@ spec:
maxLength: 80
minLength: 1
type: string
zoneType:
description: zone defines the name of a zone tag that
will be attached to a vCenter cluster. The tag category
in vCenter must be named openshift-zone.
type: string
required:
- name
- region
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,13 @@ spec:
maxLength: 80
minLength: 1
type: string
regionType:
enum:
- ""
- HostGroup
- ComputeCluster
- Datacenter
type: string
server:
anyOf:
- format: ipv4
Expand All @@ -642,6 +649,17 @@ spec:
description: Topology describes a given failure domain
using vSphere constructs
properties:
affinityGroup:
properties:
hostGroupName:
description: HostGroupName is the name of the
Host group
type: string
vmGroupName:
description: VMGroupName is the name of the
VM group
type: string
type: object
computeCluster:
description: computeCluster the absolute path of
the vCenter cluster in which virtual machine will
Expand Down Expand Up @@ -723,6 +741,16 @@ spec:
maxLength: 80
minLength: 1
type: string
zoneType:
description: zone defines the name of a zone tag that
will be attached to a vCenter cluster. The tag category
in vCenter must be named openshift-zone.
enum:
- ""
- HostGroup
- ComputeCluster
- Datacenter
type: string
required:
- name
- region
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,13 @@ spec:
maxLength: 80
minLength: 1
type: string
regionType:
enum:
- ""
- HostGroup
- ComputeCluster
- Datacenter
type: string
server:
anyOf:
- format: ipv4
Expand All @@ -642,6 +649,17 @@ spec:
description: Topology describes a given failure domain
using vSphere constructs
properties:
affinityGroup:
properties:
hostGroupName:
description: HostGroupName is the name of the
Host group
type: string
vmGroupName:
description: VMGroupName is the name of the
VM group
type: string
type: object
computeCluster:
description: computeCluster the absolute path of
the vCenter cluster in which virtual machine will
Expand Down Expand Up @@ -723,6 +741,16 @@ spec:
maxLength: 80
minLength: 1
type: string
zoneType:
description: zone defines the name of a zone tag that
will be attached to a vCenter cluster. The tag category
in vCenter must be named openshift-zone.
enum:
- ""
- HostGroup
- ComputeCluster
- Datacenter
type: string
required:
- name
- region
Expand Down
17 changes: 17 additions & 0 deletions config/v1/zz_generated.deepcopy.go

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

1 change: 1 addition & 0 deletions config/v1/zz_generated.featuregated-crd-manifests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,7 @@ infrastructures.config.openshift.io:
- GCPClusterHostedDNS
- GCPLabelsTags
- VSphereControlPlaneMachineSet
- VSphereHostVMGroupZonal
- VSphereMultiVCenters
FilenameOperatorName: config-operator
FilenameOperatorOrdering: "01"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,8 @@ spec:
maxLength: 80
minLength: 1
type: string
regionType:
type: string
server:
description: server is the fully-qualified domain name
or the IP address of the vCenter server. ---
Expand All @@ -638,6 +640,17 @@ spec:
description: Topology describes a given failure domain
using vSphere constructs
properties:
affinityGroup:
properties:
hostGroupName:
description: HostGroupName is the name of the
Host group
type: string
vmGroupName:
description: VMGroupName is the name of the
VM group
type: string
type: object
computeCluster:
description: computeCluster the absolute path of
the vCenter cluster in which virtual machine will
Expand Down Expand Up @@ -703,6 +716,11 @@ spec:
maxLength: 80
minLength: 1
type: string
zoneType:
description: zone defines the name of a zone tag that
will be attached to a vCenter cluster. The tag category
in vCenter must be named openshift-zone.
type: string
required:
- name
- region
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,8 @@ spec:
maxLength: 80
minLength: 1
type: string
regionType:
type: string
server:
description: server is the fully-qualified domain name
or the IP address of the vCenter server. ---
Expand All @@ -638,6 +640,17 @@ spec:
description: Topology describes a given failure domain
using vSphere constructs
properties:
affinityGroup:
properties:
hostGroupName:
description: HostGroupName is the name of the
Host group
type: string
vmGroupName:
description: VMGroupName is the name of the
VM group
type: string
type: object
computeCluster:
description: computeCluster the absolute path of
the vCenter cluster in which virtual machine will
Expand Down Expand Up @@ -703,6 +716,11 @@ spec:
maxLength: 80
minLength: 1
type: string
zoneType:
description: zone defines the name of a zone tag that
will be attached to a vCenter cluster. The tag category
in vCenter must be named openshift-zone.
type: string
required:
- name
- region
Expand Down
Loading

0 comments on commit 3ea73d9

Please sign in to comment.