Skip to content

Commit

Permalink
Add HighAvailabilityMode field to 'infrastructure' CRD
Browse files Browse the repository at this point in the history
Implements enhancement openshift/enhancements#555

Signed-off-by: Ravid Brown <[email protected]>
  • Loading branch information
Ravid Brown committed Jan 26, 2021
1 parent 5935a5b commit bd95d15
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 7 deletions.
27 changes: 27 additions & 0 deletions config/v1/0000_10_config-operator_01_infrastructure.crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,18 @@ spec:
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
(developer and production) for example, and the operators should
not configure the operand for highly-available operation
type: string
default: HighlyAvailable
enum:
- HighlyAvailable
- SingleReplica
etcdDiscoveryDomain:
description: 'etcdDiscoveryDomain is the domain used to fetch the
SRV records for discovering etcd servers and clients. For more info:
Expand All @@ -185,6 +197,21 @@ spec:
a human friendly name. Once set it should not be changed. Must be
of max length 27 and must have only alphanumeric or hyphen characters.
type: string
infrastructureTopology:
description: InfrastructureTopology expresses the expectations for
infrastructure services that do not run on control plane nodes,
usually indicated by a node selector for a `role` value other than
`master`. This includes, but is not necessarily limited to, the
registry, logging, monitoring, and router services. In the future,
it also could be used by additional add-on features such as kubevirt,
serverless, mesh, pipelines, or any other supporting infrastructure
service as a hint to understand what availability posture they should
provide by default.
type: string
default: HighlyAvailable
enum:
- HighlyAvailable
- SingleReplica
platform:
description: "platform is the underlying infrastructure provider for
the cluster. \n Deprecated: Use platformStatus.type instead."
Expand Down
30 changes: 30 additions & 0 deletions config/v1/types_infrastructure.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,38 @@ type InfrastructureStatus struct {
// like kubelets, to contact the Kubernetes API server using the
// infrastructure provider rather than Kubernetes networking.
APIServerInternalURL string `json:"apiServerInternalURI"`

// 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 (developer and production) for example,
// and the operators should not configure the operand for highly-available operation
// +kubebuilder:default=HighlyAvailable
ControlPlaneTopology TopologyMode `json:"controlPlaneTopology"`

// InfrastructureTopology expresses the expectations for infrastructure services that do not run on control
// plane nodes, usually indicated by a node selector for a `role` value
// other than `master`. This includes, but is not necessarily limited to,
// the registry, logging, monitoring, and router services. In the future,
// it also could be used by additional add-on features such as kubevirt,
// serverless, mesh, pipelines, or any other supporting infrastructure
// service as a hint to understand what availability posture they should
// provide by default.
// +kubebuilder:default=HighlyAvailable
InfrastructureTopology TopologyMode `json:"infrastructureTopology"`
}

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

const (
// "HighlyAvailable" is for operators to configure high-availability as much as possible.
HighlyAvailableTopologyMode TopologyMode = "HighlyAvailable"

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

// PlatformType is a specific supported infrastructure provider.
// +kubebuilder:validation:Enum="";AWS;Azure;BareMetal;GCP;Libvirt;OpenStack;None;VSphere;oVirt;IBMCloud;KubeVirt
type PlatformType string
Expand Down
16 changes: 9 additions & 7 deletions 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.

0 comments on commit bd95d15

Please sign in to comment.