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
4 changes: 3 additions & 1 deletion config/v1/0000_10_config-operator_01_infrastructure.crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,13 @@ spec:
description: apiServerURL is a valid URI with scheme 'https', address and optionally a port (defaulting to 443). apiServerURL can be used by components like the web console to tell users where to find the Kubernetes API.
type: string
controlPlaneTopology:
description: controlPlaneTopology expresses the expectations for operands that normally run on control nodes. The default is 'HighlyAvailable', which represents the behavior operators have in a "normal" cluster. The 'SingleReplica' mode will be used in single-node deployments and the operators should not configure the operand for highly-available operation
description: controlPlaneTopology expresses the expectations for operands that normally run on control nodes. The default is 'HighlyAvailable', which represents the behavior operators have in a "normal" cluster. The 'SingleReplica' mode will be used in single-node deployments 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.
type: string
default: HighlyAvailable
enum:
- HighlyAvailable
- SingleReplica
- External
etcdDiscoveryDomain:
description: 'etcdDiscoveryDomain is the domain used to fetch the SRV records for discovering etcd servers and clients. For more info: https://github.com/etcd-io/etcd/blob/329be66e8b3f9e2e6af83c123ff89297e49ebd15/Documentation/op-guide/clustering.md#dns-discovery deprecated: as of 4.7, this field is no longer set or honored. It will be removed in a future release.'
type: string
Expand All @@ -142,6 +143,7 @@ spec:
enum:
- HighlyAvailable
- SingleReplica
- External
Copy link
Contributor

Choose a reason for hiding this comment

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

are we actually consistent about infra?

in hypershift we have some infra components that run external (olm) and some that run on cluster (registry) right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That is correct. From an operator point of view, I don't think the External value makes sense for infra topology (Unless we really externalize all of infra). It is meant to apply only to control plane topology for now. However, not sure that we can express that through the API as it is.

Copy link
Contributor

Choose a reason for hiding this comment

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

So "external" will not be a valid value for status.infrastructureTopology ?

I guess can understand not creating another Type to split them, so i guess we can live with this but it is somewhat unfortunate that it confusingly implies it is valid, even if practice we'd never actually set it to that value.

platform:
description: "platform is the underlying infrastructure provider for the cluster. \n Deprecated: Use platformStatus.type instead."
type: string
Expand Down
10 changes: 9 additions & 1 deletion config/v1/types_infrastructure.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ type InfrastructureStatus struct {
// The default is 'HighlyAvailable', which represents the behavior operators have in a "normal" cluster.
// The 'SingleReplica' mode will be used in single-node deployments
// 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.
// +kubebuilder:default=HighlyAvailable
ControlPlaneTopology TopologyMode `json:"controlPlaneTopology"`

Expand All @@ -96,7 +98,7 @@ type InfrastructureStatus struct {
}

// TopologyMode defines the topology mode of the control/infra nodes.
// +kubebuilder:validation:Enum=HighlyAvailable;SingleReplica
// +kubebuilder:validation:Enum=HighlyAvailable;SingleReplica;External

Choose a reason for hiding this comment

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

If we move this declaration up to the fields above, we can provide different enum values and prevent the infra topology from being set to external. We would want a comment here to explain why we're doing it that way, too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dhellmann I like this suggestion. We can then make sure we don't set an invalid value for infra topology. Will submit a follow up PR

type TopologyMode string

const (
Expand All @@ -105,6 +107,12 @@ const (

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

// "External" indicates that the component is running externally to the cluster. When specified
// as the control plane topology, operators should avoid scheduling workloads to masters or assume
// that any of the control plane components such as kubernetes API server or etcd are visible within
// the cluster.
ExternalTopologyMode TopologyMode = "External"
)

// PlatformType is a specific supported infrastructure provider.
Expand Down
2 changes: 1 addition & 1 deletion config/v1/zz_generated.swagger_doc_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.