Skip to content

Commit 35af750

Browse files
committed
feat: add HighlyAvailableArbiter control plane topology as feature for techpreview
Signed-off-by: ehila <ehila@redhat.com>
1 parent 053bb8a commit 35af750

File tree

42 files changed

+4504
-65
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+4504
-65
lines changed
Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
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+
featureGate: HighlyAvailableArbiter
5+
tests:
6+
onCreate:
7+
- name: Should be able to create a minimal Infrastructure
8+
initial: |
9+
apiVersion: config.openshift.io/v1
10+
kind: Infrastructure
11+
spec: {} # No spec is required for a Infrastructure
12+
expected: |
13+
apiVersion: config.openshift.io/v1
14+
kind: Infrastructure
15+
spec: {}
16+
onUpdate:
17+
- name: status should allow controlPlaneTopology value for `HighlyAvailableArbiter`
18+
initial: |
19+
apiVersion: config.openshift.io/v1
20+
kind: Infrastructure
21+
spec:
22+
platformSpec:
23+
aws: {}
24+
type: AWS
25+
updated: |
26+
apiVersion: config.openshift.io/v1
27+
kind: Infrastructure
28+
spec:
29+
platformSpec:
30+
type: AWS
31+
aws: {}
32+
status:
33+
controlPlaneTopology: HighlyAvailableArbiter
34+
infrastructureTopology: HighlyAvailable
35+
platform: AWS
36+
platformStatus:
37+
aws: {}
38+
type: AWS
39+
expected: |
40+
apiVersion: config.openshift.io/v1
41+
kind: Infrastructure
42+
spec:
43+
platformSpec:
44+
type: AWS
45+
aws: {}
46+
status:
47+
controlPlaneTopology: HighlyAvailableArbiter
48+
cpuPartitioning: None
49+
infrastructureTopology: HighlyAvailable
50+
platform: AWS
51+
platformStatus:
52+
aws:
53+
cloudLoadBalancerConfig:
54+
dnsType: PlatformDefault
55+
type: AWS
56+
- name: status should allow changing controlPlaneTopology value to `HighlyAvailableArbiter`
57+
initial: |
58+
apiVersion: config.openshift.io/v1
59+
kind: Infrastructure
60+
spec:
61+
platformSpec:
62+
aws: {}
63+
type: AWS
64+
status:
65+
controlPlaneTopology: HighlyAvailable
66+
infrastructureTopology: HighlyAvailable
67+
platform: AWS
68+
platformStatus:
69+
aws: {}
70+
type: AWS
71+
updated: |
72+
apiVersion: config.openshift.io/v1
73+
kind: Infrastructure
74+
spec:
75+
platformSpec:
76+
type: AWS
77+
aws: {}
78+
status:
79+
controlPlaneTopology: HighlyAvailableArbiter
80+
infrastructureTopology: HighlyAvailable
81+
platform: AWS
82+
platformStatus:
83+
aws: {}
84+
type: AWS
85+
expected: |
86+
apiVersion: config.openshift.io/v1
87+
kind: Infrastructure
88+
spec:
89+
platformSpec:
90+
type: AWS
91+
aws: {}
92+
status:
93+
controlPlaneTopology: HighlyAvailableArbiter
94+
cpuPartitioning: None
95+
infrastructureTopology: HighlyAvailable
96+
platform: AWS
97+
platformStatus:
98+
aws:
99+
cloudLoadBalancerConfig:
100+
dnsType: PlatformDefault
101+
type: AWS
102+
- name: should not allow changing infrastructureTopology value to `HighlyAvailableArbiter`
103+
initial: |
104+
apiVersion: config.openshift.io/v1
105+
kind: Infrastructure
106+
spec:
107+
platformSpec:
108+
aws: {}
109+
type: AWS
110+
status:
111+
controlPlaneTopology: HighlyAvailable
112+
infrastructureTopology: HighlyAvailable
113+
platform: AWS
114+
platformStatus:
115+
aws: {}
116+
type: AWS
117+
updated: |
118+
apiVersion: config.openshift.io/v1
119+
kind: Infrastructure
120+
spec:
121+
platformSpec:
122+
type: AWS
123+
aws: {}
124+
status:
125+
controlPlaneTopology: HighlyAvailable
126+
infrastructureTopology: HighlyAvailableArbiter
127+
platform: AWS
128+
platformStatus:
129+
aws: {}
130+
type: AWS
131+
expectedStatusError: 'status.infrastructureTopology: Unsupported value: "HighlyAvailableArbiter": supported values: "HighlyAvailable", "SingleReplica"'

config/v1/types_infrastructure.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ type InfrastructureStatus struct {
9999
// The 'External' mode indicates that the control plane is hosted externally to the cluster and that
100100
// its components are not visible within the cluster.
101101
// +kubebuilder:default=HighlyAvailable
102-
// +kubebuilder:validation:Enum=HighlyAvailable;SingleReplica;External
102+
// +openshift:validation:FeatureGateAwareEnum:featureGate="",enum=HighlyAvailable;SingleReplica;External
103+
// +openshift:validation:FeatureGateAwareEnum:featureGate=HighlyAvailableArbiter,enum=HighlyAvailable;HighlyAvailableArbiter;SingleReplica;External
103104
ControlPlaneTopology TopologyMode `json:"controlPlaneTopology"`
104105

105106
// infrastructureTopology expresses the expectations for infrastructure services that do not run on control
@@ -136,6 +137,9 @@ const (
136137
// "HighlyAvailable" is for operators to configure high-availability as much as possible.
137138
HighlyAvailableTopologyMode TopologyMode = "HighlyAvailable"
138139

140+
// "HighlyAvailableArbiter" is for operators to configure for an arbiter HA deployment.
141+
HighlyAvailableArbiterMode TopologyMode = "HighlyAvailableArbiter"
142+
139143
// "SingleReplica" is for operators to avoid spending resources for high-availability purpose.
140144
SingleReplicaTopologyMode TopologyMode = "SingleReplica"
141145

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
@@ -975,6 +975,7 @@ spec:
975975
its components are not visible within the cluster.
976976
enum:
977977
- HighlyAvailable
978+
- HighlyAvailableArbiter
978979
- SingleReplica
979980
- External
980981
type: string

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
@@ -975,6 +975,7 @@ spec:
975975
its components are not visible within the cluster.
976976
enum:
977977
- HighlyAvailable
978+
- HighlyAvailableArbiter
978979
- SingleReplica
979980
- External
980981
type: string

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
@@ -975,6 +975,7 @@ spec:
975975
its components are not visible within the cluster.
976976
enum:
977977
- HighlyAvailable
978+
- HighlyAvailableArbiter
978979
- SingleReplica
979980
- External
980981
type: string

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,7 @@ infrastructures.config.openshift.io:
315315
- BareMetalLoadBalancer
316316
- GCPClusterHostedDNS
317317
- GCPLabelsTags
318+
- HighlyAvailableArbiter
318319
- NutanixMultiSubnets
319320
- VSphereControlPlaneMachineSet
320321
- VSphereMultiNetworks

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -939,10 +939,6 @@ spec:
939939
and the operators should not configure the operand for highly-available operation
940940
The 'External' mode indicates that the control plane is hosted externally to the cluster and that
941941
its components are not visible within the cluster.
942-
enum:
943-
- HighlyAvailable
944-
- SingleReplica
945-
- External
946942
type: string
947943
cpuPartitioning:
948944
default: None

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -939,10 +939,6 @@ spec:
939939
and the operators should not configure the operand for highly-available operation
940940
The 'External' mode indicates that the control plane is hosted externally to the cluster and that
941941
its components are not visible within the cluster.
942-
enum:
943-
- HighlyAvailable
944-
- SingleReplica
945-
- External
946942
type: string
947943
cpuPartitioning:
948944
default: None

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -939,10 +939,6 @@ spec:
939939
and the operators should not configure the operand for highly-available operation
940940
The 'External' mode indicates that the control plane is hosted externally to the cluster and that
941941
its components are not visible within the cluster.
942-
enum:
943-
- HighlyAvailable
944-
- SingleReplica
945-
- External
946942
type: string
947943
cpuPartitioning:
948944
default: None

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -939,10 +939,6 @@ spec:
939939
and the operators should not configure the operand for highly-available operation
940940
The 'External' mode indicates that the control plane is hosted externally to the cluster and that
941941
its components are not visible within the cluster.
942-
enum:
943-
- HighlyAvailable
944-
- SingleReplica
945-
- External
946942
type: string
947943
cpuPartitioning:
948944
default: None

0 commit comments

Comments
 (0)