Skip to content

Conversation

@ravidbro
Copy link

Implements enhancement openshift/enhancements#555

Signed-off-by: Ravid Brown [email protected]

@romfreiman
Copy link

@marun

type: string
enum:
- ""
- Full
Copy link
Contributor

Choose a reason for hiding this comment

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

how about something along ThreeNode ?

Choose a reason for hiding this comment

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

I think in the enhancement we want to have either full or non-ha. How ThreeNodes will help?

Copy link
Contributor

Choose a reason for hiding this comment

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

is there half HA ? APIs should be clear when you read them. Full and None have no meaning.

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for the link. Let's move the bigshedding there. I should have guessed that this field has been bikeshedded to death already ;-)

@romfreiman
Copy link

@ravidbro once the enhancement is merged, lets update this PR.

@ravidbro
Copy link
Author

@ravidbro once the enhancement is merged, lets update this PR.

Updated according to the merged enhancement

the operand for highly-available operation
type: string
enum:
- ""
Copy link
Contributor

Choose a reason for hiding this comment

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

why do we need empty? Can't we default to HighlyAvailable?

Copy link
Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

that comment does not explain why we don't just use a default, making the API easier to use and observe.

Copy link
Author

Choose a reason for hiding this comment

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

@staebler can you elaborate on why do you think we should have the empty value and not a default?

Copy link
Author

Choose a reason for hiding this comment

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

The empty option was removed

// 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
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.

// +default=HighlyAvailable

Copy link
Author

Choose a reason for hiding this comment

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

this field is only under the 'status' and not under the 'spec'.
does it need to have a default in the definition here?

Copy link
Contributor

Choose a reason for hiding this comment

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

It does not have to. But a default value shows up automatically if not set otherwise. What should operators do if this field is not set?

Copy link
Author

Choose a reason for hiding this comment

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

I see your point, I will add it

Choose a reason for hiding this comment

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

In the enhancement we said that if the field wasn't set operators should assume HighlyAvailable as a default. If setting the default in the CRD definition ensures that a value is provided for clusters upgraded from 4.7 to 4.8 (when the field is added), then maybe we didn't need to worry about that?

Copy link
Author

Choose a reason for hiding this comment

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

I checked it, and I can't use a default value here since this CRD is apiextensions.k8s.io/v1beta1, and default values aren't supported yet.

Copy link
Contributor

Choose a reason for hiding this comment

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

I checked it, and I can't use a default value here since this CRD is apiextensions.k8s.io/v1beta1, and default values aren't supported yet.

Switch it to v1. We have done that with many CRDs in openshift/api already. No reason not to, just time.

Choose a reason for hiding this comment

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

@sttts not sure we have extra time to invest into it at this point. do we understand how much effort is it?

Copy link
Contributor

@sttts sttts Jan 18, 2021

Choose a reason for hiding this comment

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

#834 merged. It's v1 CRD now.

Copy link
Author

Choose a reason for hiding this comment

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

Updated the default here and tested the upgrade from an old version. The fields were added to the existing 'cluster' CR with the default value.

@ravidbro ravidbro force-pushed the add_ha_mode branch 3 times, most recently from 7c43428 to 24a7b5b Compare January 14, 2021 14:33
// +kubebuilder:default=HighlyAvailable
ControlPlaneTopology TopologyMode `json:"controlPlaneTopology"`

// InfrastructureTopology expresses the expectations for operands that normally run on infrastructure nodes.
Copy link
Member

Choose a reason for hiding this comment

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

"infrastructure nodes" are an OSD thing, not an OCP thing, and this is an OCP config structure. I realize that the enhancement discussed this addition, and am sorry I missed this in review there. Thoughts about revisiting in the enhancement, or discussing here, or...? I guess this API change will not land before 4.7 splits off master anyway, so we have some time...

Choose a reason for hiding this comment

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

Where else would we put the new field?

This was added at @derekwaynecarr's suggestion for the external control plane work, which makes me think the idea of infrastructure nodes is coming to OCP?

Copy link
Member

@wking wking Jan 14, 2021

Choose a reason for hiding this comment

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

@derekwaynecarr proposing a control-plane/infra split here, with an eye to future External control plane settings or some such. That seems cross-cutty to me. As long as the only two values are HighlyAvailable and SingleReplica, I can't think of a situation where folks would set one value for ControlPlaneTopology and another for InfrastructureTopology. If we eventually grow External, the distinction would be:

ControlPlaneTopology stops being a way to tell control-plane components how available to be, and becomes a way to tell the remaining components that the control plane components are not local.

I'd rather have addressed that with a cluster-profile knob, since we're using the cluster-profile knob to actually remove the control-plane components. As it stands, which way would, say, the registry operator go? It tolerates the control-plane nodes, but also stays local, even in the IBM/ROKS case where the bulk of the control-plane moves to external hosting. Maybe all the components that fall into that category won't care about this setting anyway (anything managed by the CVO, which includes the registry-operator manifest, will not care about these settings). But it seems like "second-level operators should consume InfrastructureTopology when they are running, and look to ControlPlaneTopology in the future if it grows External"? That makes the names a bit wonky, but seems like the logic folks were going for?

Choose a reason for hiding this comment

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

IIUC the goal for the registry operator is to leverage the cluster profiles to support the IBM/ROKS use case:
openshift/cluster-image-registry-operator#643
We (monitoring team) have a similar WIP PR from @csrwng to move the cluster monitoring operator from the control plane nodes to the worker nodes.

Copy link
Contributor

Choose a reason for hiding this comment

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

@wking @simonpasquier I think we can draw a line between what cluster profiles do and what these fields are meant to accomplish. Cluster profiles affect the manifests that get laid down for operators by the CVO. In the cases that @simonpasquier pointed out, there is no opportunity to change the node selectors via operator logic because they will be laid down directly by the CVO, so if we need alternate node selectors we have to have the CVO handle it.

Cluster profiles could also be used to drive logic in the operator such as adding an environment variable or some other change to an operator manifest to indicate that it should work in HA/non-HA mode. But IMHO it would be less than ideal because then each operator gets to decide how this is communicated to them and they may not agree on what each mode means. My understanding is that these fields are a consistent way to communicate to operators the desired availability mode.

For possible combinations see openshift/enhancements#555 (comment)

Choose a reason for hiding this comment

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

@derekwaynecarr suggested the split. I'm not 100% clear on what goes on each side of the line myself. We should probably go back and document that better in the enhancement (and in comments here).

Copy link
Member

Choose a reason for hiding this comment

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

@wking this is not to be read as literal as role=infra nodes. it should be understood as components that provide supporting infrastructure services for applications on the cluster but are not run on control plane hosts by default. for example, it would include components like the registry, router, and monitoring. today those components can be selected to run on node with role=infra but they default to role=worker. what this field is intending to capture is if those supporting services should run highly available or not. it could be read by additional add-ons as a hint in the future for kubevirt, serverless, mesh, pipelines, or any other supporting infrastructure service to understand what availability posture their supporting solution should provide by default.

a very simple use case is a cluster whose control plane is externalized, but whose infrastructure services do not require HA. for example, an IBM ROKS/Satellite cluster with a single worker. this would require a router to not error when its not running HA, which this flag would signal as the desired state.

so maybe update text as follows:

InfrastructureTopology expresses the expectations for operands that provide supporting infrastructure services for workloads on the cluster, but do not run on control hosts by default.  If an operator API provides a node selector for placement of its operands, the operator should respect this API for expressing its availability absent any local override.

Copy link
Member

@derekwaynecarr derekwaynecarr Jan 25, 2021

Choose a reason for hiding this comment

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

an alternative scenario is regular standalone highly-available topology (3 control plane hosts) with a single worker. in that model, i may desire HA control plane topology, and SingleReplica Infrastructure Topology. it is acceptible in that instance to run a single replica of the registry for example.

Choose a reason for hiding this comment

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

I've proposed an update to the original API enhancement to clarify this. See openshift/enhancements#605

Copy link
Author

Choose a reason for hiding this comment

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

I updated the comment in the code accordingly.

@ravidbro ravidbro force-pushed the add_ha_mode branch 4 times, most recently from c44d842 to 68bddd8 Compare January 18, 2021 13:15
@romfreiman
Copy link

romfreiman commented Jan 18, 2021

@wking @csrwng @derekwaynecarr how do you suggest to proceed regrading the "infrastructure nodes" nodes discussion?
#827 (comment)
Are we good as it is now? Or extra infa/changes are required?
Here is an example how it should be used in ingress:
https://github.com/openshift/cluster-ingress-operator/pull/532/files#diff-99c0290799daf9abc6240df64063e20bfaf67b371577b67ac7eec6f4725622ffR189

@csrwng
Copy link
Contributor

csrwng commented Jan 18, 2021

@romfreiman for me, it's fine as it is

@romfreiman
Copy link

@wking what about you?

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

Choose a reason for hiding this comment

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

I think we can stop with the period after "master" here, and leave the next 2 sentences out of the CRD definition.

Copy link
Author

Choose a reason for hiding this comment

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

done

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`.

Choose a reason for hiding this comment

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

Do we need to duplicate the descriptions of the 2 modes from above?

Copy link
Author

Choose a reason for hiding this comment

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

I think it makes sense also here, and I copied it.

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

Choose a reason for hiding this comment

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

Since this is user-facing, we don't need to differentiate between the types of deployments.

Suggested change
(developer and production) for example, and the operators should
and the operators should

Copy link
Author

Choose a reason for hiding this comment

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

changed

Copy link

@dhellmann dhellmann left a comment

Choose a reason for hiding this comment

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

The current draft looks good to me.

/approve

the Kubernetes API.
type: string
controlPlaneTopology:
description: ControlPlaneTopology expresses the expectations for operands
Copy link
Contributor

Choose a reason for hiding this comment

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

lower-case

Copy link
Author

Choose a reason for hiding this comment

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

done

of max length 27 and must have only alphanumeric or hyphen characters.
type: string
infrastructureTopology:
description: InfrastructureTopology expresses the expectations for
Copy link
Contributor

Choose a reason for hiding this comment

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

lower-case

Copy link
Author

Choose a reason for hiding this comment

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

done

@sttts
Copy link
Contributor

sttts commented Jan 28, 2021

LGTM. nit: lower-case the field name in descriptions

/approve

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 28, 2021
@sttts
Copy link
Contributor

sttts commented Jan 28, 2021

/hold

until master opens.

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 28, 2021
@romfreiman
Copy link

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jan 28, 2021
@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dhellmann, ravidbro, romfreiman, sttts

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@romfreiman
Copy link

/retest

1 similar comment
@ravidbro
Copy link
Author

/retest

@romfreiman
Copy link

/hold cancel

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 4, 2021
@ravidbro
Copy link
Author

ravidbro commented Feb 7, 2021

/retest

@ravidbro
Copy link
Author

ravidbro commented Feb 8, 2021

/bugzilla refresh

@openshift-ci-robot
Copy link

@ravidbro: No Bugzilla bug is referenced in the title of this pull request.
To reference a bug, add 'Bug XXX:' to the title of this pull request and request another bug refresh with /bugzilla refresh.

Details

In response to this:

/bugzilla refresh

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Copy link

@simonpasquier simonpasquier left a comment

Choose a reason for hiding this comment

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

redacted (wrong tab)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.