Skip to content

Commit eba1ad6

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

File tree

44 files changed

+4770
-69
lines changed

Some content is hidden

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

44 files changed

+4770
-69
lines changed
Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
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+
- HighlyAvailableArbiter
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 `HighlyAvailableArbiter`
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: HighlyAvailableArbiter
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: HighlyAvailableArbiter
49+
cpuPartitioning: None
50+
infrastructureTopology: HighlyAvailable
51+
platform: AWS
52+
platformStatus:
53+
aws:
54+
cloudLoadBalancerConfig:
55+
dnsType: PlatformDefault
56+
type: AWS
57+
- name: status should allow changing controlPlaneTopology value to `HighlyAvailableArbiter`
58+
initial: |
59+
apiVersion: config.openshift.io/v1
60+
kind: Infrastructure
61+
spec:
62+
platformSpec:
63+
aws: {}
64+
type: AWS
65+
status:
66+
controlPlaneTopology: HighlyAvailable
67+
infrastructureTopology: HighlyAvailable
68+
platform: AWS
69+
platformStatus:
70+
aws: {}
71+
type: AWS
72+
updated: |
73+
apiVersion: config.openshift.io/v1
74+
kind: Infrastructure
75+
spec:
76+
platformSpec:
77+
type: AWS
78+
aws: {}
79+
status:
80+
controlPlaneTopology: HighlyAvailableArbiter
81+
infrastructureTopology: HighlyAvailable
82+
platform: AWS
83+
platformStatus:
84+
aws: {}
85+
type: AWS
86+
expected: |
87+
apiVersion: config.openshift.io/v1
88+
kind: Infrastructure
89+
spec:
90+
platformSpec:
91+
type: AWS
92+
aws: {}
93+
status:
94+
controlPlaneTopology: HighlyAvailableArbiter
95+
cpuPartitioning: None
96+
infrastructureTopology: HighlyAvailable
97+
platform: AWS
98+
platformStatus:
99+
aws:
100+
cloudLoadBalancerConfig:
101+
dnsType: PlatformDefault
102+
type: AWS
103+
- name: should not allow changing infrastructureTopology value to `HighlyAvailableArbiter`
104+
initial: |
105+
apiVersion: config.openshift.io/v1
106+
kind: Infrastructure
107+
spec:
108+
platformSpec:
109+
aws: {}
110+
type: AWS
111+
status:
112+
controlPlaneTopology: HighlyAvailable
113+
infrastructureTopology: HighlyAvailable
114+
platform: AWS
115+
platformStatus:
116+
aws: {}
117+
type: AWS
118+
updated: |
119+
apiVersion: config.openshift.io/v1
120+
kind: Infrastructure
121+
spec:
122+
platformSpec:
123+
type: AWS
124+
aws: {}
125+
status:
126+
controlPlaneTopology: HighlyAvailable
127+
infrastructureTopology: HighlyAvailableArbiter
128+
platform: AWS
129+
platformStatus:
130+
aws: {}
131+
type: AWS
132+
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
@@ -98,7 +98,8 @@ type InfrastructureStatus struct {
9898
// The 'External' mode indicates that the control plane is hosted externally to the cluster and that
9999
// its components are not visible within the cluster.
100100
// +kubebuilder:default=HighlyAvailable
101-
// +kubebuilder:validation:Enum=HighlyAvailable;SingleReplica;External
101+
// +openshift:validation:FeatureGateAwareEnum:featureGate="",enum=HighlyAvailable;SingleReplica;External
102+
// +openshift:validation:FeatureGateAwareEnum:featureGate=HighlyAvailableArbiter,enum=HighlyAvailable;HighlyAvailableArbiter;SingleReplica;External
102103
ControlPlaneTopology TopologyMode `json:"controlPlaneTopology"`
103104

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

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

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
@@ -1066,6 +1066,7 @@ spec:
10661066
its components are not visible within the cluster.
10671067
enum:
10681068
- HighlyAvailable
1069+
- HighlyAvailableArbiter
10691070
- SingleReplica
10701071
- External
10711072
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
@@ -1066,6 +1066,7 @@ spec:
10661066
its components are not visible within the cluster.
10671067
enum:
10681068
- HighlyAvailable
1069+
- HighlyAvailableArbiter
10691070
- SingleReplica
10701071
- External
10711072
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
@@ -1066,6 +1066,7 @@ spec:
10661066
its components are not visible within the cluster.
10671067
enum:
10681068
- HighlyAvailable
1069+
- HighlyAvailableArbiter
10691070
- SingleReplica
10701071
- External
10711072
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
- VSphereHostVMGroupZonal

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
@@ -1019,10 +1019,6 @@ spec:
10191019
and the operators should not configure the operand for highly-available operation
10201020
The 'External' mode indicates that the control plane is hosted externally to the cluster and that
10211021
its components are not visible within the cluster.
1022-
enum:
1023-
- HighlyAvailable
1024-
- SingleReplica
1025-
- External
10261022
type: string
10271023
cpuPartitioning:
10281024
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
@@ -1019,10 +1019,6 @@ spec:
10191019
and the operators should not configure the operand for highly-available operation
10201020
The 'External' mode indicates that the control plane is hosted externally to the cluster and that
10211021
its components are not visible within the cluster.
1022-
enum:
1023-
- HighlyAvailable
1024-
- SingleReplica
1025-
- External
10261022
type: string
10271023
cpuPartitioning:
10281024
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
@@ -1019,10 +1019,6 @@ spec:
10191019
and the operators should not configure the operand for highly-available operation
10201020
The 'External' mode indicates that the control plane is hosted externally to the cluster and that
10211021
its components are not visible within the cluster.
1022-
enum:
1023-
- HighlyAvailable
1024-
- SingleReplica
1025-
- External
10261022
type: string
10271023
cpuPartitioning:
10281024
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
@@ -1019,10 +1019,6 @@ spec:
10191019
and the operators should not configure the operand for highly-available operation
10201020
The 'External' mode indicates that the control plane is hosted externally to the cluster and that
10211021
its components are not visible within the cluster.
1022-
enum:
1023-
- HighlyAvailable
1024-
- SingleReplica
1025-
- External
10261022
type: string
10271023
cpuPartitioning:
10281024
default: None

0 commit comments

Comments
 (0)