Skip to content
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

SPLAT-1743: vSphere - add host and vm based zonal #1999

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions config/v1/types_infrastructure.go
Original file line number Diff line number Diff line change
Expand Up @@ -1148,6 +1148,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 @@ -1166,6 +1177,15 @@ type VSpherePlatformFailureDomainSpec struct {
// +kubebuilder:validation:Required
Region string `json:"region"`

// regionType defines the type of region that is used for this failure domain. The current available options
// are "", ComputeCluster and Datacenter.
// +openshift:validation:FeatureGateAwareEnum:featureGate=VSphereHostVMGroupZonal,enum="";ComputeCluster;Datacenter
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength=80
// +kubebuilder:validation:Optional
// +optional
RegionType string `json:"regionType,omitempty"`

// 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 @@ -1174,6 +1194,15 @@ type VSpherePlatformFailureDomainSpec struct {
// +kubebuilder:validation:Required
Zone string `json:"zone"`

// zoneType defines the type of zone that is used for this failure domain. The current available options
// are "", HostGroup and ComputeCluster.
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength=80
// +kubebuilder:validation:Optional
// +openshift:validation:FeatureGateAwareEnum:featureGate=VSphereHostVMGroupZonal,enum="";HostGroup;ComputeCluster
// +optional
ZoneType string `json:"zoneType,omitempty"`

// 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 @@ -1261,6 +1290,34 @@ type VSpherePlatformTopology struct {
// +kubebuilder:validation:Pattern=`^/.*?/vm/.*?`
// +optional
Template string `json:"template,omitempty"`

// affinityGroup holds the names of the host and vm groups that
// will be used for HostGroup based failure domains.
//
// +openshift:validation:featureGate=VSphereHostVMGroupZonal
// +kubebuilder:validation:Optional
// +optional
AffinityGroup VSphereFailureDomainAffinityGroup `json:"affinityGroup,omitempty"`
}

type VSphereFailureDomainAffinityGroup struct {
// VMGroupName is the name of the VM group within vCenter for this failure domain
// +openshift:validation:featureGate=VSphereHostVMGroupZonal
// +kubebuilder:validation:MaxLength=80
// +optional
VMGroup string `json:"vmGroup,omitempty"`

// HostGroupName is the name of the Host group within vcenter for this failure domain
// +openshift:validation:featureGate=VSphereHostVMGroupZonal
// +kubebuilder:validation:MaxLength=80
// +optional
HostGroup string `json:"hostGroup,omitempty"`

// VMHostRule is the name of the vm host rule within vCenter for this failure domain
// +openshift:validation:featureGate=VSphereHostVMGroupZonal
// +kubebuilder:validation:MaxLength=80
// +optional
VMHostRule string `json:"vmHostRule,omitempty"`
}

// VSpherePlatformVCenterSpec stores the vCenter connection fields.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,17 @@ spec:
maxLength: 80
minLength: 1
type: string
regionType:
description: regionType defines the type of region that
is used for this failure domain. The current available
options are "", ComputeCluster and Datacenter.
enum:
- ""
- ComputeCluster
- Datacenter
maxLength: 80
minLength: 1
type: string
server:
anyOf:
- format: ipv4
Expand All @@ -642,6 +653,29 @@ spec:
description: Topology describes a given failure domain
using vSphere constructs
properties:
affinityGroup:
description: affinityGroup holds the names of the
host and vm groups that will be used for HostGroup
based failure domains.
properties:
hostGroup:
description: HostGroupName is the name of the
Host group within vcenter for this failure
domain
maxLength: 80
type: string
vmGroup:
description: VMGroupName is the name of the
VM group within vCenter for this failure domain
maxLength: 80
type: string
vmHostRule:
description: VMHostRule is the name of the vm
host rule within vCenter for this failure
domain
maxLength: 80
type: string
type: object
computeCluster:
description: computeCluster the absolute path of
the vCenter cluster in which virtual machine will
Expand Down Expand Up @@ -725,6 +759,17 @@ spec:
maxLength: 80
minLength: 1
type: string
zoneType:
description: zoneType defines the type of zone that
is used for this failure domain. The current available
options are "", HostGroup and ComputeCluster.
enum:
- ""
- HostGroup
- ComputeCluster
maxLength: 80
minLength: 1
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:
description: regionType defines the type of region that
is used for this failure domain. The current available
options are "", ComputeCluster and Datacenter.
maxLength: 80
minLength: 1
type: string
server:
anyOf:
- format: ipv4
Expand All @@ -642,6 +649,29 @@ spec:
description: Topology describes a given failure domain
using vSphere constructs
properties:
affinityGroup:
description: affinityGroup holds the names of the
host and vm groups that will be used for HostGroup
based failure domains.
properties:
hostGroup:
description: HostGroupName is the name of the
Host group within vcenter for this failure
domain
maxLength: 80
type: string
vmGroup:
description: VMGroupName is the name of the
VM group within vCenter for this failure domain
maxLength: 80
type: string
vmHostRule:
description: VMHostRule is the name of the vm
host rule within vCenter for this failure
domain
maxLength: 80
type: string
type: object
computeCluster:
description: computeCluster the absolute path of
the vCenter cluster in which virtual machine will
Expand Down Expand Up @@ -725,6 +755,13 @@ spec:
maxLength: 80
minLength: 1
type: string
zoneType:
description: zoneType defines the type of zone that
is used for this failure domain. The current available
options are "", HostGroup and ComputeCluster.
maxLength: 80
minLength: 1
type: string
required:
- name
- region
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,17 @@ spec:
maxLength: 80
minLength: 1
type: string
regionType:
description: regionType defines the type of region that
is used for this failure domain. The current available
options are "", ComputeCluster and Datacenter.
enum:
- ""
- ComputeCluster
- Datacenter
maxLength: 80
minLength: 1
type: string
server:
anyOf:
- format: ipv4
Expand All @@ -642,6 +653,29 @@ spec:
description: Topology describes a given failure domain
using vSphere constructs
properties:
affinityGroup:
description: affinityGroup holds the names of the
host and vm groups that will be used for HostGroup
based failure domains.
properties:
hostGroup:
description: HostGroupName is the name of the
Host group within vcenter for this failure
domain
maxLength: 80
type: string
vmGroup:
description: VMGroupName is the name of the
VM group within vCenter for this failure domain
maxLength: 80
type: string
vmHostRule:
description: VMHostRule is the name of the vm
host rule within vCenter for this failure
domain
maxLength: 80
type: string
type: object
computeCluster:
description: computeCluster the absolute path of
the vCenter cluster in which virtual machine will
Expand Down Expand Up @@ -725,6 +759,17 @@ spec:
maxLength: 80
minLength: 1
type: string
zoneType:
description: zoneType defines the type of zone that
is used for this failure domain. The current available
options are "", HostGroup and ComputeCluster.
enum:
- ""
- HostGroup
- ComputeCluster
maxLength: 80
minLength: 1
type: string
required:
- name
- region
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,17 @@ spec:
maxLength: 80
minLength: 1
type: string
regionType:
description: regionType defines the type of region that
is used for this failure domain. The current available
options are "", ComputeCluster and Datacenter.
enum:
- ""
- ComputeCluster
- Datacenter
maxLength: 80
minLength: 1
type: string
server:
anyOf:
- format: ipv4
Expand All @@ -642,6 +653,29 @@ spec:
description: Topology describes a given failure domain
using vSphere constructs
properties:
affinityGroup:
description: affinityGroup holds the names of the
host and vm groups that will be used for HostGroup
based failure domains.
properties:
hostGroup:
description: HostGroupName is the name of the
Host group within vcenter for this failure
domain
maxLength: 80
type: string
vmGroup:
description: VMGroupName is the name of the
VM group within vCenter for this failure domain
maxLength: 80
type: string
vmHostRule:
description: VMHostRule is the name of the vm
host rule within vCenter for this failure
domain
maxLength: 80
type: string
type: object
computeCluster:
description: computeCluster the absolute path of
the vCenter cluster in which virtual machine will
Expand Down Expand Up @@ -725,6 +759,17 @@ spec:
maxLength: 80
minLength: 1
type: string
zoneType:
description: zoneType defines the type of zone that
is used for this failure domain. The current available
options are "", HostGroup and ComputeCluster.
enum:
- ""
- HostGroup
- ComputeCluster
maxLength: 80
minLength: 1
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 @@ -314,6 +314,7 @@ infrastructures.config.openshift.io:
- GCPClusterHostedDNS
- GCPLabelsTags
- VSphereControlPlaneMachineSet
- VSphereHostVMGroupZonal
- VSphereMultiNetworks
- VSphereMultiVCenters
FilenameOperatorName: config-operator
Expand Down
Loading