Skip to content

Commit

Permalink
feat: add HighlyAvailableArbiter control plane topology as feature fo…
Browse files Browse the repository at this point in the history
…r techpreview

Signed-off-by: ehila <[email protected]>
  • Loading branch information
eggfoobar committed Nov 4, 2024
1 parent 04eb3fd commit c174c2e
Show file tree
Hide file tree
Showing 40 changed files with 4,428 additions and 63 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
apiVersion: apiextensions.k8s.io/v1 # Hack because controller-gen complains if we don't have this
name: "Infrastructure"
crdName: infrastructures.config.openshift.io
featureGate: HighlyAvailableArbiter
tests:
onCreate:
- name: Should be able to create a minimal Infrastructure
initial: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec: {} # No spec is required for a Infrastructure
expected: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec: {}
onUpdate:
- name: status should allow `HighlyAvailableArbiter` for control plane topology
initial: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec:
platformSpec:
aws: {}
type: AWS
updated: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec:
platformSpec:
type: AWS
aws: {}
status:
controlPlaneTopology: HighlyAvailableArbiter
infrastructureTopology: HighlyAvailable
platform: AWS
platformStatus:
aws: {}
type: AWS
expected: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec:
platformSpec:
type: AWS
aws: {}
status:
controlPlaneTopology: HighlyAvailableArbiter
cpuPartitioning: None
infrastructureTopology: HighlyAvailable
platform: AWS
platformStatus:
aws:
cloudLoadBalancerConfig:
dnsType: PlatformDefault
type: AWS
- name: status should allow update to `HighlyAvailableArbiter` for control plane topology
initial: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec:
platformSpec:
aws: {}
type: AWS
status:
controlPlaneTopology: HighlyAvailable
infrastructureTopology: HighlyAvailable
platform: AWS
platformStatus:
aws: {}
type: AWS
updated: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec:
platformSpec:
type: AWS
aws: {}
status:
controlPlaneTopology: HighlyAvailableArbiter
infrastructureTopology: HighlyAvailable
platform: AWS
platformStatus:
aws: {}
type: AWS
expected: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec:
platformSpec:
type: AWS
aws: {}
status:
controlPlaneTopology: HighlyAvailableArbiter
cpuPartitioning: None
infrastructureTopology: HighlyAvailable
platform: AWS
platformStatus:
aws:
cloudLoadBalancerConfig:
dnsType: PlatformDefault
type: AWS
6 changes: 5 additions & 1 deletion config/v1/types_infrastructure.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ type InfrastructureStatus struct {
// The 'External' mode indicates that the control plane is hosted externally to the cluster and that
// its components are not visible within the cluster.
// +kubebuilder:default=HighlyAvailable
// +kubebuilder:validation:Enum=HighlyAvailable;SingleReplica;External
// +openshift:validation:FeatureGateAwareEnum:featureGate="",enum=HighlyAvailable;SingleReplica;External
// +openshift:validation:FeatureGateAwareEnum:featureGate=HighlyAvailableArbiter,enum=HighlyAvailable;HighlyAvailableArbiter;SingleReplica;External
ControlPlaneTopology TopologyMode `json:"controlPlaneTopology"`

// infrastructureTopology expresses the expectations for infrastructure services that do not run on control
Expand Down Expand Up @@ -136,6 +137,9 @@ const (
// "HighlyAvailable" is for operators to configure high-availability as much as possible.
HighlyAvailableTopologyMode TopologyMode = "HighlyAvailable"

// "HighlyAvailableArbiter" is for operators to configure for an arbiter HA deployment.
HighlyAvailableArbiter TopologyMode = "HighlyAvailableArbiter"

// "SingleReplica" is for operators to avoid spending resources for high-availability purpose.
SingleReplicaTopologyMode TopologyMode = "SingleReplica"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -958,6 +958,7 @@ spec:
its components are not visible within the cluster.
enum:
- HighlyAvailable
- HighlyAvailableArbiter
- SingleReplica
- External
type: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -958,6 +958,7 @@ spec:
its components are not visible within the cluster.
enum:
- HighlyAvailable
- HighlyAvailableArbiter
- SingleReplica
- External
type: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -958,6 +958,7 @@ spec:
its components are not visible within the cluster.
enum:
- HighlyAvailable
- HighlyAvailableArbiter
- SingleReplica
- External
type: string
Expand Down
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:
- BareMetalLoadBalancer
- GCPClusterHostedDNS
- GCPLabelsTags
- HighlyAvailableArbiter
- VSphereControlPlaneMachineSet
- VSphereMultiNetworks
- VSphereMultiVCenters
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -927,10 +927,6 @@ spec:
and the operators should not configure the operand for highly-available operation
The 'External' mode indicates that the control plane is hosted externally to the cluster and that
its components are not visible within the cluster.
enum:
- HighlyAvailable
- SingleReplica
- External
type: string
cpuPartitioning:
default: None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -927,10 +927,6 @@ spec:
and the operators should not configure the operand for highly-available operation
The 'External' mode indicates that the control plane is hosted externally to the cluster and that
its components are not visible within the cluster.
enum:
- HighlyAvailable
- SingleReplica
- External
type: string
cpuPartitioning:
default: None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -927,10 +927,6 @@ spec:
and the operators should not configure the operand for highly-available operation
The 'External' mode indicates that the control plane is hosted externally to the cluster and that
its components are not visible within the cluster.
enum:
- HighlyAvailable
- SingleReplica
- External
type: string
cpuPartitioning:
default: None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -927,10 +927,6 @@ spec:
and the operators should not configure the operand for highly-available operation
The 'External' mode indicates that the control plane is hosted externally to the cluster and that
its components are not visible within the cluster.
enum:
- HighlyAvailable
- SingleReplica
- External
type: string
cpuPartitioning:
default: None
Expand Down
Loading

0 comments on commit c174c2e

Please sign in to comment.