Skip to content

Commit 80ff76b

Browse files
committed
feat: add dualreplica featuregate
add feature gate to support DualReplica control plante topology as a featuregate for two node openshift deployments Signed-off-by: ehila <[email protected]>
1 parent afdfbaf commit 80ff76b

File tree

14 files changed

+4600
-0
lines changed

14 files changed

+4600
-0
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 & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ type InfrastructureStatus struct {
100100
// +kubebuilder:default=HighlyAvailable
101101
// +openshift:validation:FeatureGateAwareEnum:featureGate="",enum=HighlyAvailable;SingleReplica;External
102102
// +openshift:validation:FeatureGateAwareEnum:featureGate=HighlyAvailableArbiter,enum=HighlyAvailable;HighlyAvailableArbiter;SingleReplica;External
103+
// +openshift:validation:FeatureGateAwareEnum:featureGate=DualReplica,enum=HighlyAvailable;SingleReplica;DualReplica;External
103104
ControlPlaneTopology TopologyMode `json:"controlPlaneTopology"`
104105

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

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

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
- GCPClusterHostedDNS
317318
- GCPLabelsTags
318319
- HighlyAvailableArbiter

config/v1/zz_generated.featuregated-crd-manifests/infrastructures.config.openshift.io/DualReplica.yaml

Lines changed: 1974 additions & 0 deletions
Large diffs are not rendered by default.

features.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
| ClusterMonitoringConfig| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
1818
| ConsolePluginContentSecurityPolicy| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
1919
| DNSNameResolver| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
20+
| DualReplica| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
2021
| DynamicResourceAllocation| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
2122
| EtcdBackendQuota| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
2223
| Example| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |

features/features.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -734,4 +734,12 @@ var (
734734
enhancementPR("https://github.com/openshift/enhancements/pull/1492").
735735
enableIn(configv1.DevPreviewNoUpgrade).
736736
mustRegister()
737+
738+
FeatureGateDualReplica = newFeatureGate("DualReplica").
739+
reportProblemsToJiraComponent("Two Node Fencing").
740+
contactPerson("jaypoulz").
741+
productScope(ocpSpecific).
742+
enhancementPR("https://github.com/openshift/enhancements/pull/1675").
743+
enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
744+
mustRegister()
737745
)

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ controllerconfigs.machineconfiguration.openshift.io:
3030
FeatureGates:
3131
- AWSClusterHostedDNS
3232
- BareMetalLoadBalancer
33+
- DualReplica
3334
- GCPClusterHostedDNS
3435
- GCPLabelsTags
3536
- HighlyAvailableArbiter

0 commit comments

Comments
 (0)