Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
apiVersion: apiextensions.k8s.io/v1 # Hack because controller-gen complains if we don't have this
name: "Infrastructure"
crdName: infrastructures.config.openshift.io
featureGates:
- HighlyAvailableArbiter
tests:
onCreate:
- name: Should be able to create a minimal Infrastructure
initial: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec: {} # No spec is required for a Infrastructure
expected: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec: {}
onUpdate:
- name: status should allow controlPlaneTopology value for `HighlyAvailableArbiter`
initial: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec:
platformSpec:
aws: {}
type: AWS
updated: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec:
platformSpec:
type: AWS
aws: {}
status:
controlPlaneTopology: HighlyAvailableArbiter
infrastructureTopology: HighlyAvailable
platform: AWS
platformStatus:
aws: {}
type: AWS
expected: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec:
platformSpec:
type: AWS
aws: {}
status:
controlPlaneTopology: HighlyAvailableArbiter
cpuPartitioning: None
infrastructureTopology: HighlyAvailable
platform: AWS
platformStatus:
aws:
cloudLoadBalancerConfig:
dnsType: PlatformDefault
type: AWS
- name: should not allow changing infrastructureTopology value to `HighlyAvailableArbiter`
initial: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec:
platformSpec:
aws: {}
type: AWS
updated: |
apiVersion: config.openshift.io/v1
kind: Infrastructure
spec:
platformSpec:
type: AWS
aws: {}
status:
controlPlaneTopology: HighlyAvailable
infrastructureTopology: HighlyAvailableArbiter
platform: AWS
platformStatus:
aws: {}
type: AWS
expectedStatusError: 'status.infrastructureTopology: Unsupported value: "HighlyAvailableArbiter": supported values: "HighlyAvailable", "SingleReplica"'
6 changes: 5 additions & 1 deletion config/v1/types_infrastructure.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ type InfrastructureStatus struct {
// The 'External' mode indicates that the control plane is hosted externally to the cluster and that
// its components are not visible within the cluster.
// +kubebuilder:default=HighlyAvailable
// +kubebuilder:validation:Enum=HighlyAvailable;SingleReplica;External
// +openshift:validation:FeatureGateAwareEnum:featureGate="",enum=HighlyAvailable;SingleReplica;External
// +openshift:validation:FeatureGateAwareEnum:featureGate=HighlyAvailableArbiter,enum=HighlyAvailable;HighlyAvailableArbiter;SingleReplica;External
ControlPlaneTopology TopologyMode `json:"controlPlaneTopology"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This field should not be able to modified day 2 right? The test you have in place shows that it can be changed. Your proposal explicitly calls out that this cannot be changed day 2, so why does that test pass?

In general, I think this field should never have been mutable, perhaps we just need to make it immutable

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, this was an older test where we originally had planned to update in the future (i.e moving from arbiter cluster to regular 3Node cluster), but regardless of that, to my knowledge we don't have something that enforces the status of ControlPlaneTopology, so that's why this test passes.

Changing this status is not supported in the current version of OCP, and I don't know if it would be a problem to make it immutable for the time being, since I think that would be a behavior change that some components might be relying on, for example I don't know if during bootstrap this ever gets applied then changed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to bring this up at the control plane arch call today and see what we think. IMO, this should always have been marked as immutable (once its set that is, "" -> ""` should be allowed)


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

// "HighlyAvailableArbiter" is for operators to configure for an arbiter HA deployment.
HighlyAvailableArbiterMode TopologyMode = "HighlyAvailableArbiter"

// "SingleReplica" is for operators to avoid spending resources for high-availability purpose.
SingleReplicaTopologyMode TopologyMode = "SingleReplica"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1066,6 +1066,7 @@ spec:
its components are not visible within the cluster.
enum:
- HighlyAvailable
- HighlyAvailableArbiter
- SingleReplica
- External
type: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1066,6 +1066,7 @@ spec:
its components are not visible within the cluster.
enum:
- HighlyAvailable
- HighlyAvailableArbiter
- SingleReplica
- External
type: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1066,6 +1066,7 @@ spec:
its components are not visible within the cluster.
enum:
- HighlyAvailable
- HighlyAvailableArbiter
- SingleReplica
- External
type: string
Expand Down
1 change: 1 addition & 0 deletions config/v1/zz_generated.featuregated-crd-manifests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ infrastructures.config.openshift.io:
- BareMetalLoadBalancer
- GCPClusterHostedDNS
- GCPLabelsTags
- HighlyAvailableArbiter
- NutanixMultiSubnets
- VSphereControlPlaneMachineSet
- VSphereHostVMGroupZonal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1019,10 +1019,6 @@ spec:
and the operators should not configure the operand for highly-available operation
The 'External' mode indicates that the control plane is hosted externally to the cluster and that
its components are not visible within the cluster.
enum:
- HighlyAvailable
- SingleReplica
- External
type: string
cpuPartitioning:
default: None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1019,10 +1019,6 @@ spec:
and the operators should not configure the operand for highly-available operation
The 'External' mode indicates that the control plane is hosted externally to the cluster and that
its components are not visible within the cluster.
enum:
- HighlyAvailable
- SingleReplica
- External
type: string
cpuPartitioning:
default: None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1019,10 +1019,6 @@ spec:
and the operators should not configure the operand for highly-available operation
The 'External' mode indicates that the control plane is hosted externally to the cluster and that
its components are not visible within the cluster.
enum:
- HighlyAvailable
- SingleReplica
- External
type: string
cpuPartitioning:
default: None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1019,10 +1019,6 @@ spec:
and the operators should not configure the operand for highly-available operation
The 'External' mode indicates that the control plane is hosted externally to the cluster and that
its components are not visible within the cluster.
enum:
- HighlyAvailable
- SingleReplica
- External
type: string
cpuPartitioning:
default: None
Expand Down
Loading