-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Reported conditions don't align with established conventions #4975
Comments
Hi Nico 👋 having read your issue I agree with you that we should try and follow the conventions! I'll review your PR but @simonpasquier will be the best person to discuss the design decisions. Thanks for the contribution! |
Yes there's a difference:
As I understood the conventions doc, True, False and Unknown are recommended but it doesn't tell that an operator should limit itself to these values (e.g.
It represents the last status from the last reconciliation, it provides feedback to the user as to why the operator can't converge to the desired state (for instance, a reference to a secret key can't be resolved).
I agree that it should be added. |
Hi @simonpasquier , I understand the reasoning behind reporting a degraded state, but this should be reported as a separate condition. e.g. a Prometheus deployment can be both
The API conventions doc gives little room for ambiguity, specifying each field in detail, including the
It's also consistent throughout all kube apis as far as I can tell: https://github.com/kubernetes/api |
We are implementing a higher-level controller on top of github.com/rhobs/observability-operator, as part of github.com/openshift/addon-operator.
Now we want to use the new status conditions posted by OO and Prometheus Operator, but this left us confused as these conditions seem to behave different to other conditions.
Condition Status is either "True", "False" or "Unkown"
Prometheus Operator and also Observability Operator are reporting an extra "Degraded" status, which is doesn't map to any existing API convention and makes interpreting status harder.
Is there a difference between: Type: "Available", Status: "False" and Status: "Degraded"?
Is "Degraded" referring to the condition itself or the operator being degraded and thus should not be taken for granted?
Kubernetes API conventions
What state does the "Reconciled" condition represent?
If the controller was able to post that condition, it - by definition - reconciled something.
Whether the status is up to date is already represented by reporting .observedGeneration.
edit ObservedGeneration is currently not reported at all, making it impossible to judge if status is stale or not.
(nit/suggestion) Conditions could use standardized conditions from apimachinery and their helper functions to make handling easier:
Standardized Conditions from k8s/apimachinery
Standardized Condition helper functions from k8s/apimachinery
This is not a blocker for us, but to quote from API conventions:
Right now it's very easy to miss-interpret status reported by Prometheus Operator and by extension OO.
Thanks for reading!
The text was updated successfully, but these errors were encountered: