Skip to content

Bug 1699134: pkg/daemon: add reason annotation key for degraded/unreconcilable and bubble up errors from render controller - #597

Merged
openshift-merge-robot merged 5 commits into
openshift:masterfrom
runcom:degraded-reason
Apr 24, 2019
Merged

openshift-merge-robot merged 5 commits into
openshift:masterfrom
runcom:degraded-reason

Conversation

@runcom

@runcom runcom commented Apr 2, 2019 •

Copy link
Copy Markdown
Member

Signed-off-by: Antonio Murdaca [email protected]

- What I did

Close #234
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1699134

Added a new Reason annotation key set to the specific error we get when failing to reconcile + reintroduced degraded from runcom@e753f10#diff-3bd49282ca65e5525da44a27caaa55c7L80 + bubbling up errors from pool

- How to verify it

added a check in one of the e2e

- Description for the changelog

@openshift-ci-robot openshift-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Apr 2, 2019

@cgwalters cgwalters left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

At least in the case where there's only 1 unavailable node, we may want to also change the operator to roll this up into its status?

But doesn't need to be done in this PR. Just one issue I see.

Comment thread pkg/daemon/writer.go Resolved
Comment thread test/e2e/mcd_test.go Resolved
@runcom

runcom commented Apr 11, 2019

Copy link
Copy Markdown
Member Author

At least in the case where there's only 1 unavailable node, we may want to also change the operator to roll this up into its status?

I thought about this and maybe we just need a Failing status in the MCP itself telling the most recent failures if we MCD keeps failing (and that can be then bubbled up to the operator itself)

@runcom runcom changed the title pkg/daemon: add reason annotation key for degraded/unreconcilable WIP: pkg/daemon: add reason annotation key for degraded/unreconcilable Apr 12, 2019
@openshift-ci-robot openshift-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 12, 2019
@runcom runcom changed the title WIP: pkg/daemon: add reason annotation key for degraded/unreconcilable WIP: Bug 1699134: pkg/daemon: add reason annotation key for degraded/unreconcilable Apr 12, 2019
@runcom runcom changed the title WIP: Bug 1699134: pkg/daemon: add reason annotation key for degraded/unreconcilable WIP: pkg/daemon: add reason annotation key for degraded/unreconcilable Apr 18, 2019
@runcom

runcom commented Apr 18, 2019 •

Copy link
Copy Markdown
Member Author

WIP cause I'm reworking this one to take into account https://bugzilla.redhat.com/show_bug.cgi?id=1699134 (which is gonna be simpler to fix in this PR with the changes being implemented here)

TODO for myself: 1) change title of this + 2) fix commit message describing everything I did here

/hold

@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 Apr 18, 2019
@runcom runcom changed the title WIP: pkg/daemon: add reason annotation key for degraded/unreconcilable WIP: Bug 1699134: pkg/daemon: add reason annotation key for degraded/unreconcilable Apr 18, 2019
@openshift-ci-robot openshift-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Apr 18, 2019
@runcom
runcom force-pushed the degraded-reason branch 7 times, most recently from 7c8e5dc to eb74ae6 Compare April 23, 2019 10:32
@runcom runcom changed the title WIP: Bug 1699134: pkg/daemon: add reason annotation key for degraded/unreconcilable WIP: Bug 1699134: pkg/daemon: add reason annotation key for degraded/unreconcilable and bubble up errors from render controller Apr 23, 2019
@runcom

runcom commented Apr 23, 2019 •

Copy link
Copy Markdown
Member Author

@cgwalters @kikisdeliveryservice @LorbusChris ptal at this (last BZ for 4.1). I still have to take care of Colin's comment to clear out the degraded/unreconcilable annotation when flipping back to a good state but this should now fixes the BZ linked as in:

  • if the render_controller fails (e.g. missing Ignition version), we now set the pool to Degraded
  • if the pool is in Degraded, the operator will report Failing=True as well (given it's the master pool as we behave today anyway)
  • the pool reports degraded with reasons from nodes now

@runcom
runcom force-pushed the degraded-reason branch 3 times, most recently from adc2dd7 to 1567469 Compare April 23, 2019 14:35
continue
}

if dconfig == currentConfig &&

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

same

Comment thread pkg/operator/sync.go Resolved
@kikisdeliveryservice

Copy link
Copy Markdown
Contributor

did adding the new test cause the timeout? looking

@runcom

runcom commented Apr 23, 2019

Copy link
Copy Markdown
Member Author

did adding the new test cause the timeout? looking

yeah, cause I'm not clearing the Degraded=True which is basically node_controller stomping on template_controller for who sets that - I'm trying to figure that out

@kikisdeliveryservice

Copy link
Copy Markdown
Contributor

did adding the new test cause the timeout? looking

yeah, cause I'm not clearing the Degraded=True which is basically node_controller stomping on template_controller for who sets that - I'm trying to figure that out

gotcha! tho looking at the numbers we are starting to get close to the max time anyway (your test only ran for 5 minutes), so we'll likely have to extend timeout in the near future (since we have that one test that takes 36 minutes)

@runcom

runcom commented Apr 23, 2019 •

Copy link
Copy Markdown
Member Author

gotcha! tho looking at the numbers we are starting to get close to the max time anyway (your test only ran for 5 minutes), so we'll likely have to extend timeout in the near future (since we have that one test that takes 36 minutes)

yup 👍

Anyway, so we do have this issue now:

NodeController wants to set/clear Degraded
RenderController wants to set/clear Degraded

There seems to be no good solution to each of them stomping on each other and flipping status is a no-go anyway. One solution I see is letting NodeController manage the MCP anyway but that requires the RenderController a CRD-like-ControllerConfig where it can report that it failed to render. If it failed to render, the NodeController would check that CRD to see if it needs to set/clear out Degraded on MCP.
Looks like a more elegant solution (if not the only one) and something we need to solve anyway as current code doesn't work as expected?

WDYT? (we also need to make sure landing something like this doesn't break upgrade after declaring api freeze as I don't believe we can break anything adding fields/crd anyway)

@kikisdeliveryservice

Copy link
Copy Markdown
Contributor

@runcom if the state is unreconcilable it is also degraded?

@runcom

runcom commented Apr 23, 2019

Copy link
Copy Markdown
Member Author

@runcom if the state is unreconcilable it is also degraded?

yeah, unreconcilable is a subset of degraded cause it's something in the config. Degraded is when things fail in a general way (transient errors as well)

@kikisdeliveryservice

Copy link
Copy Markdown
Contributor

if unreconcilable is a subset of degraded but now degraded has a reason, is there a point to unreconcilable?

i thought that the idea of having both was to have them be independent error/failure states esp since we had no way of knowing why something had been previously degraded and to avoid something small (like a small MC issue) causing a node to degrade since it was overkill?

@runcom

runcom commented Apr 23, 2019

Copy link
Copy Markdown
Member Author

Lengthy talked with Abhinav who helped me figuring this out, I'm pushing out a change shortly but basically:

  • introduce a NodeDegraded condition which flips to true when it does today (as usual w/o changing logic)
  • introduce a RenderDegraded condition which flips to true when render fails
  • NodeController makes the final call to set Degraded on the MCP (as it understands NodeDegraded & RenderDegraded = Degraded but we can change that in the future to a dedicated controller or control loop)

@kikisdeliveryservice

Copy link
Copy Markdown
Contributor

Lengthy talked with Abhinav who helped me figuring this out, I'm pushing out a change shortly but basically:

* introduce a NodeDegraded condition which flips to true when it does today (as usual w/o changing logic)

* introduce a RenderDegraded condition which flips to true when render fails

* NodeController makes the final call to set Degraded on the MCP (as it understands NodeDegraded & RenderDegraded = Degraded but we can change that in the future to a dedicated controller or control loop)

I think that this makes sense.

@runcom

runcom commented Apr 23, 2019

Copy link
Copy Markdown
Member Author

if unreconcilable is a subset of degraded but now degraded has a reason, is there a point to unreconcilable?

clarity between "something in kube fails" vs "something in the MC you provided" fails

i thought that the idea of having both was to have them be independent error/failure states esp since we had no way of knowing why something had been previously degraded and to avoid something small (like a small MC issue) causing a node to degrade since it was overkill?

Oh yeah, I'm still on board with that, but we're not yet on "MC issue -> no degrade", that's a long term aim that we need to tackle

@cgwalters

Copy link
Copy Markdown
Member

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Apr 23, 2019
Comment thread pkg/controller/node/status.go Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This could just be } else { though if you end up respinning.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

fixed eventually

This is going to allow us to report a final Degraded condition (in
NodeController today but it might go away in the future) for a given MCP
so we can bubble all of this up to the Operator (and flip it to failing
if the pool is the master pool).
@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Apr 23, 2019
@kikisdeliveryservice

Copy link
Copy Markdown
Contributor

/lgtm

@kikisdeliveryservice

Copy link
Copy Markdown
Contributor

/LGTM

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Apr 23, 2019
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cgwalters, kikisdeliveryservice, runcom

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:
  • OWNERS [cgwalters,kikisdeliveryservice,runcom]

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

@openshift-merge-robot
openshift-merge-robot merged commit c7b2270 into openshift:master Apr 24, 2019
@runcom
runcom deleted the degraded-reason branch April 24, 2019 06:36
ptalgulk01 pushed a commit to ptalgulk01/machine-config-operator that referenced this pull request May 15, 2026
Bug 1699134: pkg/daemon: add reason annotation key for degraded/unreconcilable and bubble up errors from render controller
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. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a Degraded annotation

5 participants