Skip to content

Commit b7593dd

Browse files
committed
feat: add dualreplica featuregate
add feature gate to support DualReplica control plante topology as a featuregate for two node openshift deployments. added todo to make sure we do not go GA with out resolving the annotation issue. Signed-off-by: ehila <[email protected]>
1 parent f2caafd commit b7593dd

File tree

29 files changed

+4768
-3
lines changed

29 files changed

+4768
-3
lines changed
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
apiVersion: apiextensions.k8s.io/v1 # Hack because controller-gen complains if we don't have this
2+
name: "Infrastructure"
3+
crdName: infrastructures.config.openshift.io
4+
featureGates:
5+
- DualReplica
6+
tests:
7+
onCreate:
8+
- name: Should be able to create a minimal Infrastructure
9+
initial: |
10+
apiVersion: config.openshift.io/v1
11+
kind: Infrastructure
12+
spec: {} # No spec is required for a Infrastructure
13+
expected: |
14+
apiVersion: config.openshift.io/v1
15+
kind: Infrastructure
16+
spec: {}
17+
onUpdate:
18+
- name: status should allow controlPlaneTopology value for `DualReplica`
19+
initial: |
20+
apiVersion: config.openshift.io/v1
21+
kind: Infrastructure
22+
spec:
23+
platformSpec:
24+
aws: {}
25+
type: AWS
26+
updated: |
27+
apiVersion: config.openshift.io/v1
28+
kind: Infrastructure
29+
spec:
30+
platformSpec:
31+
type: AWS
32+
aws: {}
33+
status:
34+
controlPlaneTopology: DualReplica
35+
infrastructureTopology: HighlyAvailable
36+
platform: AWS
37+
platformStatus:
38+
aws: {}
39+
type: AWS
40+
expected: |
41+
apiVersion: config.openshift.io/v1
42+
kind: Infrastructure
43+
spec:
44+
platformSpec:
45+
type: AWS
46+
aws: {}
47+
status:
48+
controlPlaneTopology: DualReplica
49+
cpuPartitioning: None
50+
infrastructureTopology: HighlyAvailable
51+
platform: AWS
52+
platformStatus:
53+
aws:
54+
cloudLoadBalancerConfig:
55+
dnsType: PlatformDefault
56+
type: AWS
57+
- name: should not allow changing infrastructureTopology value to `DualReplica`
58+
initial: |
59+
apiVersion: config.openshift.io/v1
60+
kind: Infrastructure
61+
spec:
62+
platformSpec:
63+
aws: {}
64+
type: AWS
65+
updated: |
66+
apiVersion: config.openshift.io/v1
67+
kind: Infrastructure
68+
spec:
69+
platformSpec:
70+
type: AWS
71+
aws: {}
72+
status:
73+
controlPlaneTopology: HighlyAvailable
74+
infrastructureTopology: DualReplica
75+
platform: AWS
76+
platformStatus:
77+
aws: {}
78+
type: AWS
79+
expectedStatusError: 'status.infrastructureTopology: Unsupported value: "DualReplica": supported values: "HighlyAvailable", "SingleReplica"'

config/v1/types_infrastructure.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ type InfrastructureStatus struct {
9999
// its components are not visible within the cluster.
100100
// +kubebuilder:default=HighlyAvailable
101101
// +openshift:validation:FeatureGateAwareEnum:featureGate="",enum=HighlyAvailable;SingleReplica;External
102-
// +openshift:validation:FeatureGateAwareEnum:featureGate=HighlyAvailableArbiter,enum=HighlyAvailable;HighlyAvailableArbiter;SingleReplica;External
102+
// +openshift:validation:FeatureGateAwareEnum:featureGate=HighlyAvailableArbiter;DualReplica,enum=HighlyAvailable;HighlyAvailableArbiter;SingleReplica;DualReplica;External
103103
ControlPlaneTopology TopologyMode `json:"controlPlaneTopology"`
104104

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

145+
// "DualReplica" is for operators to configure for two node topology.
146+
DualReplicaTopologyMode TopologyMode = "DualReplica"
147+
145148
// "External" indicates that the component is running externally to the cluster. When specified
146149
// as the control plane topology, operators should avoid scheduling workloads to masters or assume
147150
// that any of the control plane components such as kubernetes API server or etcd are visible within

config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_infrastructures-CustomNoUpgrade.crd.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1130,6 +1130,7 @@ spec:
11301130
- HighlyAvailable
11311131
- HighlyAvailableArbiter
11321132
- SingleReplica
1133+
- DualReplica
11331134
- External
11341135
type: string
11351136
cpuPartitioning:

config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_infrastructures-DevPreviewNoUpgrade.crd.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1130,6 +1130,7 @@ spec:
11301130
- HighlyAvailable
11311131
- HighlyAvailableArbiter
11321132
- SingleReplica
1133+
- DualReplica
11331134
- External
11341135
type: string
11351136
cpuPartitioning:

config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_infrastructures-TechPreviewNoUpgrade.crd.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1130,6 +1130,7 @@ spec:
11301130
- HighlyAvailable
11311131
- HighlyAvailableArbiter
11321132
- SingleReplica
1133+
- DualReplica
11331134
- External
11341135
type: string
11351136
cpuPartitioning:

config/v1/zz_generated.featuregated-crd-manifests.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,7 @@ infrastructures.config.openshift.io:
313313
FeatureGates:
314314
- AWSClusterHostedDNS
315315
- BareMetalLoadBalancer
316+
- DualReplica
316317
- DyanmicServiceEndpointIBMCloud
317318
- GCPClusterHostedDNS
318319
- GCPCustomAPIEndpoints

0 commit comments

Comments
 (0)