-
Notifications
You must be signed in to change notification settings - Fork 537
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OTA-1339: UpdateStatus
: API to expose information about update progress & health
#2012
base: master
Are you sure you want to change the base?
Conversation
Hello @petr-muller! Some important instructions when contributing to openshift/api: |
Skipping CI for Draft Pull Request. |
7c1d5de
to
5d0db69
Compare
ddca9e1
to
41b0a0c
Compare
UpdateStatus
: Initial working draftUpdateStatus
: Initial working draft
@petr-muller: This pull request references OTA-1339 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.18.0" version, but no target version was set. In response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
|
||
const ( | ||
// installation denotes a boolean that indicates the update was initiated as an installation | ||
InstallationMetadata VersionMetadataKey = "installation" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ControlPlaneUpdateVersions
has separate previous
and target
. Do we need an explicit "I'm the install!" marker in version metadata? Or can that be inferred from "previous
is empty"? I can't think of a situation where you'd be in the middle of a real A->B update but still care about whether A was an install version or not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this basically mimics what we do in oc
prototype:
if this was the only use case for version metadata then maybe the implicit 'previous empty implies installation' would be good enough but we have a good use case for metadata (partial) so I think it's worth being explicit, we have the mechanism for it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no problem with openshift/oc#4978e7d226e8cb2 deciding to use an explicit property internally to read more clearly. And I'm fine with you following that pattern here in the initial v1alpha1 approach. But the public-API form increases my personal threshold for whether the structure should allow inconsistent data, and "claims to be an installation
but has a different previous
" and "claims to be an update, but has no previous
" are two possible inconsistent states for this structure. But either way, feel free to mark this thread resolved, to get v1alpha1 landed :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like that point. Not having more metadata is also simpler which is always a better start. I'll change this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ended up keeping the metadata item and enforcing consistency with CEL validation. I did not like allowing empty version (it is a struct that's also used in target
where it should be never empty) so I made <none>
a special value that's only allowed in previous
and only if accompanied by Installation
metadata.
e438453
to
40182b1
Compare
Initially `UpdateStatus` was made namespaces to accomodate HCP more easily, but recently it seems the org has established a practice where HCP resources have specialized variants. We have also identified some differences in how the API will need to behave in HCP, so it makes sense to make the API cluster-scoped in standalone, and in the future we will have a HCP-specific namespaced variant.
Mostly just fixed: - `kubebuilder:validation:Required` -> `required` - `patchStrategy=merge, patchMergeKey=type` in conditions
The (identical) rule markers present on both the field and the type alias caused the generated schema to be non-structural
I was running into trouble with CRD validation because of CEL budgets. The way the API is structured makes cardinatilities high because we need to allow high amouts of insights because of nodes. Then the hypothetical worst case leads to 32 worker pools, each with 16 informers reporting 1024 insights, all of which are `ClusterVersion` status insights which have a CEL that needs validation. Such scenario is purely hypothetical but compliance to budgets is enforced by the tools. The cardinality is so high because of the top-level worker pool list (32) so the problem can be solved by separating what insights can be present in which section of the API, which is what this commit does. Alternatively, we could flatten the `informers` layer and that way we would get rid of the `16` factor, and we would be able to limit the amount of insights reported by all informers that way. The informer source is not that important for API consumers but would make the API harder to work with on the producer side.
The generated code in this repositor does not need this but the code in openshift/client-go does
d5a749b
to
aedef80
Compare
aedef80
to
8495ca6
Compare
@petr-muller: The following tests failed, say
Full PR test history. Your PR dashboard. 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-sigs/prow repository. I understand the commands that are listed here. |
Implements the API proposed in openshift/enhancements#1701 , addressing feedback on the early Update Health API Controller Proposal and Update Health API Draft docs.
Introduce a new
UpdateStatus
API (CRD) that exposes the status and health of the OpenShift cluster update process. In a typical OpenShift cluster, the API will be a singleton with an empty.spec
, and its purpose will be to expose information through itsstatus
subresource.UpdateStatus
API OverviewThe API has three conceptual layers:
.status.{controlPlane,workerPools[]}.informers
, the API exposes detailed information about individual concerns related to the update, called "Update Insights." The API is prepared to allow multiple external informers to contribute insights, but in this enhancement, the only informer is the USC itself..status.{controlPlane,workerPools[]}
reports higher-level information about the update through this layer, serving as the USC's interpretation of all insights..status.conditions
, is used to report operational matters related to the USC itself (the health of the controller and gathering the insights, not the health of the update process).We do not expect users to interact with
UpdateStatus
resources directly; the API is intended to be used mainly by tooling. A typicalUpdateStatus
instance is likely to be quite verbose.I'm keeping iterations as commits but will squash before (eventual) merge.