Skip to content

Commit

Permalink
Merge pull request openshift#2196 from eggfoobar/add-dualreplica-feat…
Browse files Browse the repository at this point in the history
…uregate

OCPEDGE-1512: feat: add dualreplica featuregate
  • Loading branch information
openshift-merge-bot[bot] authored Mar 5, 2025
2 parents 422203b + 8fb0163 commit 1cd9f24
Show file tree
Hide file tree
Showing 29 changed files with 4,768 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
apiVersion: apiextensions.k8s.io/v1 # Hack because controller-gen complains if we don't have this
name: "Infrastructure"
crdName: infrastructures.config.openshift.io
featureGates:
- DualReplica
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 `DualReplica`
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: DualReplica
infrastructureTopology: HighlyAvailable
platform: AWS
platformStatus:
aws: {}
type: AWS
expected: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec:
platformSpec:
type: AWS
aws: {}
status:
controlPlaneTopology: DualReplica
cpuPartitioning: None
infrastructureTopology: HighlyAvailable
platform: AWS
platformStatus:
aws:
cloudLoadBalancerConfig:
dnsType: PlatformDefault
type: AWS
- name: should not allow changing infrastructureTopology value to `DualReplica`
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: HighlyAvailable
infrastructureTopology: DualReplica
platform: AWS
platformStatus:
aws: {}
type: AWS
expectedStatusError: 'status.infrastructureTopology: Unsupported value: "DualReplica": supported values: "HighlyAvailable", "SingleReplica"'
5 changes: 4 additions & 1 deletion config/v1/types_infrastructure.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ type InfrastructureStatus struct {
// its components are not visible within the cluster.
// +kubebuilder:default=HighlyAvailable
// +openshift:validation:FeatureGateAwareEnum:featureGate="",enum=HighlyAvailable;SingleReplica;External
// +openshift:validation:FeatureGateAwareEnum:featureGate=HighlyAvailableArbiter,enum=HighlyAvailable;HighlyAvailableArbiter;SingleReplica;External
// +openshift:validation:FeatureGateAwareEnum:featureGate=HighlyAvailableArbiter;DualReplica,enum=HighlyAvailable;HighlyAvailableArbiter;SingleReplica;DualReplica;External
ControlPlaneTopology TopologyMode `json:"controlPlaneTopology"`

// infrastructureTopology expresses the expectations for infrastructure services that do not run on control
Expand Down Expand Up @@ -142,6 +142,9 @@ const (
// "SingleReplica" is for operators to avoid spending resources for high-availability purpose.
SingleReplicaTopologyMode TopologyMode = "SingleReplica"

// "DualReplica" is for operators to configure for two node topology.
DualReplicaTopologyMode TopologyMode = "DualReplica"

// "External" indicates that the component is running externally to the cluster. When specified
// as the control plane topology, operators should avoid scheduling workloads to masters or assume
// that any of the control plane components such as kubernetes API server or etcd are visible within
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1130,6 +1130,7 @@ spec:
- HighlyAvailable
- HighlyAvailableArbiter
- SingleReplica
- DualReplica
- External
type: string
cpuPartitioning:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1130,6 +1130,7 @@ spec:
- HighlyAvailable
- HighlyAvailableArbiter
- SingleReplica
- DualReplica
- External
type: string
cpuPartitioning:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1130,6 +1130,7 @@ spec:
- HighlyAvailable
- HighlyAvailableArbiter
- SingleReplica
- DualReplica
- External
type: string
cpuPartitioning:
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 @@ -313,6 +313,7 @@ infrastructures.config.openshift.io:
FeatureGates:
- AWSClusterHostedDNS
- BareMetalLoadBalancer
- DualReplica
- DyanmicServiceEndpointIBMCloud
- GCPClusterHostedDNS
- GCPCustomAPIEndpoints
Expand Down
Loading

0 comments on commit 1cd9f24

Please sign in to comment.