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 28, 2024
1 parent 01b3675 commit 4594e38
Show file tree
Hide file tree
Showing 41 changed files with 5,227 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ tests:
- ocp-ci-seg-13
resourcePool: /IBMCloud/host/vcs-8e-workload/Resources
template: /IBMCloud/vm/ngirard-dev-rqh5s-rhcos-generated-region-generated-zone
affinityGroup:
vmGroupName: ""
hostGroupName: ""
zone: generated-zone
nodeNetworking:
external: {}
Expand All @@ -62,6 +65,7 @@ tests:
failureDomains:
- name: generated-failure-domain
region: generated-region
regionType: ""
server: server1.dev.cluster.com
topology:
computeCluster: /IBMCloud/host/vcs-8e-workload
Expand All @@ -71,7 +75,11 @@ tests:
- ocp-ci-seg-13
resourcePool: /IBMCloud/host/vcs-8e-workload/Resources
template: /IBMCloud/vm/ngirard-dev-rqh5s-rhcos-generated-region-generated-zone
affinityGroup:
vmGroupName: ""
hostGroupName: ""
zone: generated-zone
zoneType: ""
nodeNetworking:
external: {}
internal: {}
Expand Down
51 changes: 51 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,14 +1177,33 @@ 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.

// +default=""
// +kubebuilder:default=""
// +openshift:validation:FeatureGateAwareEnum:featureGate=VSphereHostVMGroupZonal,enum="";ComputeCluster;Datacenter
// +kubebuilder:validation:Optional
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.
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength=80
// +kubebuilder:validation:Required
// +optional
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.
// +default=""
// +kubebuilder:default=""
// +kubebuilder:validation:Optional
// +openshift:validation:FeatureGateAwareEnum:featureGate=VSphereHostVMGroupZonal,enum="";HostGroup;ComputeCluster
// +optional
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 @@ -1258,6 +1288,27 @@ type VSpherePlatformTopology struct {
// +kubebuilder:validation:Pattern=`^/.*?/vm/.*?`
// +optional
Template string `json:"template,omitempty"`

// affinityGroup is the host and vm group ...
//
// +openshift:validation:featureGate=VSphereHostVMGroupZonal
// +kubebuilder:validation:Optional
// +optional
AffinityGroup VSphereFailureDomainAffinityGroup `json:"affinityGroup,omitempty"`
}

type VSphereFailureDomainAffinityGroup struct {
// VMGroupName is the name of the VM group
// +openshift:validation:featureGate=VSphereHostVMGroupZonal
// +kubebuilder:validation:MaxLength=80
// +optional
VMGroupName string `json:"vmGroupName"`

// HostGroupName is the name of the Host group
// +openshift:validation:featureGate=VSphereHostVMGroupZonal
// +kubebuilder:validation:MaxLength=80
// +optional
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:
default: ""
enum:
- ""
- ComputeCluster
- Datacenter
type: string
server:
anyOf:
- format: ipv4
Expand All @@ -642,6 +649,21 @@ spec:
description: Topology describes a given failure domain
using vSphere constructs
properties:
affinityGroup:
description: affinityGroup is the host and vm group
...
properties:
hostGroupName:
description: HostGroupName is the name of the
Host group
maxLength: 80
type: string
vmGroupName:
description: VMGroupName is the name of the
VM group
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 @@ -723,6 +745,16 @@ spec:
maxLength: 80
minLength: 1
type: string
zoneType:
default: ""
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
type: string
required:
- name
- region
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,9 @@ spec:
maxLength: 80
minLength: 1
type: string
regionType:
default: ""
type: string
server:
anyOf:
- format: ipv4
Expand All @@ -642,6 +645,21 @@ spec:
description: Topology describes a given failure domain
using vSphere constructs
properties:
affinityGroup:
description: affinityGroup is the host and vm group
...
properties:
hostGroupName:
description: HostGroupName is the name of the
Host group
maxLength: 80
type: string
vmGroupName:
description: VMGroupName is the name of the
VM group
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 @@ -723,6 +741,12 @@ spec:
maxLength: 80
minLength: 1
type: string
zoneType:
default: ""
description: zoneType defines the type of zone that
is used for this failure domain. The current available
options are "", HostGroup and ComputeCluster.
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:
default: ""
enum:
- ""
- ComputeCluster
- Datacenter
type: string
server:
anyOf:
- format: ipv4
Expand All @@ -642,6 +649,21 @@ spec:
description: Topology describes a given failure domain
using vSphere constructs
properties:
affinityGroup:
description: affinityGroup is the host and vm group
...
properties:
hostGroupName:
description: HostGroupName is the name of the
Host group
maxLength: 80
type: string
vmGroupName:
description: VMGroupName is the name of the
VM group
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 @@ -723,6 +745,16 @@ spec:
maxLength: 80
minLength: 1
type: string
zoneType:
default: ""
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
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:
default: ""
enum:
- ""
- ComputeCluster
- Datacenter
type: string
server:
anyOf:
- format: ipv4
Expand All @@ -642,6 +649,21 @@ spec:
description: Topology describes a given failure domain
using vSphere constructs
properties:
affinityGroup:
description: affinityGroup is the host and vm group
...
properties:
hostGroupName:
description: HostGroupName is the name of the
Host group
maxLength: 80
type: string
vmGroupName:
description: VMGroupName is the name of the
VM group
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 @@ -723,6 +745,16 @@ spec:
maxLength: 80
minLength: 1
type: string
zoneType:
default: ""
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
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
- VSphereMultiVCenters
FilenameOperatorName: config-operator
FilenameOperatorOrdering: "01"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,9 @@ spec:
maxLength: 80
minLength: 1
type: string
regionType:
default: ""
type: string
server:
description: server is the fully-qualified domain name
or the IP address of the vCenter server. ---
Expand All @@ -638,6 +641,21 @@ spec:
description: Topology describes a given failure domain
using vSphere constructs
properties:
affinityGroup:
description: affinityGroup is the host and vm group
...
properties:
hostGroupName:
description: HostGroupName is the name of the
Host group
maxLength: 80
type: string
vmGroupName:
description: VMGroupName is the name of the
VM group
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 @@ -703,6 +721,12 @@ spec:
maxLength: 80
minLength: 1
type: string
zoneType:
default: ""
description: zoneType defines the type of zone that
is used for this failure domain. The current available
options are "", HostGroup and ComputeCluster.
type: string
required:
- name
- region
Expand Down
Loading

0 comments on commit 4594e38

Please sign in to comment.