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

WIP: OCPEDGE-1307: feat: add HighlyAvailableArbiter control plane topology as feature for techpreview #2082

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
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 controlPlaneTopology value for `HighlyAvailableArbiter`
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 changing controlPlaneTopology value to `HighlyAvailableArbiter`
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
- name: should not allow changing infrastructureTopology value to `HighlyAvailableArbiter`
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: HighlyAvailable
infrastructureTopology: HighlyAvailableArbiter
platform: AWS
platformStatus:
aws: {}
type: AWS
expectedStatusError: 'status.infrastructureTopology: Unsupported value: "HighlyAvailableArbiter": supported values: "HighlyAvailable", "SingleReplica"'
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.
HighlyAvailableArbiterMode 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 @@ -975,6 +975,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 @@ -975,6 +975,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 @@ -975,6 +975,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 @@ -315,6 +315,7 @@ infrastructures.config.openshift.io:
- BareMetalLoadBalancer
- GCPClusterHostedDNS
- GCPLabelsTags
- HighlyAvailableArbiter
- NutanixMultiSubnets
- VSphereControlPlaneMachineSet
- VSphereMultiNetworks
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -939,10 +939,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 @@ -939,10 +939,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 @@ -939,10 +939,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 @@ -939,10 +939,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