Skip to content

Commit b3d1ab0

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 b3d1ab0

File tree

15 files changed

+4704
-0
lines changed

15 files changed

+4704
-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
)
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
apiVersion: apiextensions.k8s.io/v1 # Hack because controller-gen complains if we don't have this
2+
name: "Optimistically missing"
3+
crdName: controllerconfigs.machineconfiguration.openshift.io
4+
featureGates:
5+
- DualReplica
6+
tests:
7+
onCreate:
8+
- name: Should be able to create a minimal ControllerConfig
9+
initial: |
10+
apiVersion: machineconfiguration.openshift.io/v1
11+
kind: ControllerConfig
12+
spec:
13+
additionalTrustBundle: Y2VydGlmaWNhdGUK
14+
baseOSContainerImage: example.com/example/openshift-release-dev@sha256:d98795f7932441b30bb8bcfbbf05912875383fad1f2b3be08a22ec148d68607e
15+
baseOSExtensionsContainerImage: example.com/example/openshift-release-dev@sha256:d98795f7932441b30bb8bcfbbf05912875383fad1f2b3be08a22ec148d68607e
16+
cloudProviderCAData: null
17+
cloudProviderConfig: ""
18+
clusterDNSIP: fd02::a
19+
dns:
20+
apiVersion: config.openshift.io/v1
21+
kind: DNS
22+
spec:
23+
baseDomain: fake.redhat.com
24+
images:
25+
machineConfigOperator: rexample.com/example/openshift-release-dev@sha256:2c3ea52ac3a41c6d58e85977c3149413e3fa4b70eb2397426456863adbf43306
26+
infra:
27+
apiVersion: config.openshift.io/v1
28+
kind: Infrastructure
29+
spec:
30+
cloudConfig:
31+
name: ""
32+
platformSpec:
33+
type: None
34+
status:
35+
apiServerInternalURI: https://api-int.cnfde4.sno.ptp.lab.eng.bos.redhat.com:6443
36+
apiServerURL: https://api.cnfde4.sno.ptp.lab.eng.bos.redhat.com:6443
37+
cpuPartitioning: "None"
38+
controlPlaneTopology: DualReplica
39+
etcdDiscoveryDomain: ""
40+
infrastructureName: cnfde4-sxhr7
41+
infrastructureTopology: HighlyAvailable
42+
platform: None
43+
platformStatus:
44+
type: None
45+
ipFamilies: IPv6
46+
kubeAPIServerServingCAData: Y2VydGlmaWNhdGUK
47+
network: null
48+
networkType: OVNKubernetes
49+
osImageURL: example.com/example/openshift-release-dev@sha256:eacdc37aec78fdbf8caa9601e4012ab31453cf59b086474901900e853e803ea8
50+
platform: none
51+
proxy: null
52+
pullSecret:
53+
name: pull-secret
54+
namespace: openshift-config
55+
releaseImage: ""
56+
rootCAData: Y2VydGlmaWNhdGUK
57+
expected: |
58+
apiVersion: machineconfiguration.openshift.io/v1
59+
kind: ControllerConfig
60+
spec:
61+
additionalTrustBundle: Y2VydGlmaWNhdGUK
62+
baseOSContainerImage: example.com/example/openshift-release-dev@sha256:d98795f7932441b30bb8bcfbbf05912875383fad1f2b3be08a22ec148d68607e
63+
baseOSExtensionsContainerImage: example.com/example/openshift-release-dev@sha256:d98795f7932441b30bb8bcfbbf05912875383fad1f2b3be08a22ec148d68607e
64+
cloudProviderCAData: null
65+
cloudProviderConfig: ""
66+
clusterDNSIP: fd02::a
67+
dns:
68+
apiVersion: config.openshift.io/v1
69+
kind: DNS
70+
spec:
71+
baseDomain: fake.redhat.com
72+
images:
73+
machineConfigOperator: rexample.com/example/openshift-release-dev@sha256:2c3ea52ac3a41c6d58e85977c3149413e3fa4b70eb2397426456863adbf43306
74+
infra:
75+
apiVersion: config.openshift.io/v1
76+
kind: Infrastructure
77+
spec:
78+
cloudConfig:
79+
name: ""
80+
platformSpec:
81+
type: None
82+
status:
83+
apiServerInternalURI: https://api-int.cnfde4.sno.ptp.lab.eng.bos.redhat.com:6443
84+
apiServerURL: https://api.cnfde4.sno.ptp.lab.eng.bos.redhat.com:6443
85+
cpuPartitioning: "None"
86+
controlPlaneTopology: DualReplica
87+
etcdDiscoveryDomain: ""
88+
infrastructureName: cnfde4-sxhr7
89+
infrastructureTopology: HighlyAvailable
90+
platform: None
91+
platformStatus:
92+
type: None
93+
ipFamilies: IPv6
94+
kubeAPIServerServingCAData: Y2VydGlmaWNhdGUK
95+
network: null
96+
networkType: OVNKubernetes
97+
osImageURL: example.com/example/openshift-release-dev@sha256:eacdc37aec78fdbf8caa9601e4012ab31453cf59b086474901900e853e803ea8
98+
platform: none
99+
proxy: null
100+
pullSecret:
101+
name: pull-secret
102+
namespace: openshift-config
103+
releaseImage: ""
104+
rootCAData: Y2VydGlmaWNhdGUK

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)