Skip to content
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

Bug 1978662: Set a degraded message when persistent storage is not configured #1270

Merged

Conversation

fpetkovski
Copy link
Contributor

@fpetkovski fpetkovski commented Jul 8, 2021

When persistent storage is not configured for prometheus, upgrades and cluster disruptions can lead to data loss.
In order to make cluster admins aware of this problem, this PR adds a message to the degraded condition indicating this problem. The value of the condition is kept as degraded=false since there is no real degradation with the cluster monitoring.

  • I added CHANGELOG entry for this change.
  • No user facing changes, so no entry in CHANGELOG was needed.

@openshift-ci openshift-ci bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. bugzilla/severity-medium Referenced Bugzilla bug's severity is medium for the branch this PR is targeting. bugzilla/invalid-bug Indicates that a referenced Bugzilla bug is invalid for the branch this PR is targeting. labels Jul 8, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jul 8, 2021

@fpetkovski: This pull request references Bugzilla bug 1978662, which is invalid:

  • expected the bug to target the "4.9.0" release, but it targets "---" instead

Comment /bugzilla refresh to re-evaluate validity if changes to the Bugzilla bug are made, or edit the title of this pull request to link to a different bug.

In response to this:

WIP: Bug 1978662: Set a degraded message when persistent storage is not configured

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.

@openshift-ci openshift-ci bot requested review from arajkumar and prashbnair July 8, 2021 07:32
@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 8, 2021
@fpetkovski fpetkovski force-pushed the indicate-no-storage branch from 11a0934 to b7dd975 Compare July 8, 2021 07:38
@fpetkovski
Copy link
Contributor Author

/bugzilla refresh

@openshift-ci openshift-ci bot added the bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. label Jul 8, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jul 8, 2021

@fpetkovski: This pull request references Bugzilla bug 1978662, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.9.0) matches configured target release for branch (4.9.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

Requesting review from QA contact:
/cc @juzhao

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.

@openshift-ci openshift-ci bot removed the bugzilla/invalid-bug Indicates that a referenced Bugzilla bug is invalid for the branch this PR is targeting. label Jul 8, 2021
@openshift-ci openshift-ci bot requested a review from juzhao July 8, 2021 07:40
@fpetkovski fpetkovski force-pushed the indicate-no-storage branch from b7dd975 to f79d2bb Compare July 8, 2021 07:43
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jul 8, 2021

@fpetkovski: This pull request references Bugzilla bug 1978662, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.9.0) matches configured target release for branch (4.9.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

Requesting review from QA contact:
/cc @juzhao

In response to this:

WIP: Bug 1978662: Set a degraded message when persistent storage is not configured

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.

@fpetkovski fpetkovski force-pushed the indicate-no-storage branch from f79d2bb to 740e370 Compare July 8, 2021 07:44
@fpetkovski fpetkovski changed the title WIP: Bug 1978662: Set a degraded message when persistent storage is not configured Bug 1978662: Set a degraded message when persistent storage is not configured Jul 8, 2021
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 8, 2021
Copy link
Contributor

@arajkumar arajkumar left a comment

Choose a reason for hiding this comment

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

Added a nit and minor comment, rest lgtm :)

Copy link
Contributor

@jan--f jan--f left a comment

Choose a reason for hiding this comment

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

Two issues for this patch inline.

I'm wondering if we maybe should introduce a func (r *StatusReporter) SetDegraded function for this and set it explicitly where appropriate. We talked before about setting degraded on other conditions and generally improve the status reporting. Not needed for this PR but also wouldn't hurt I think.

@@ -77,7 +77,7 @@ func (r *StatusReporter) SetDone() error {
conditions := newConditions(co.Status, r.version, time)
conditions.setCondition(v1.OperatorAvailable, v1.ConditionTrue, "Successfully rolled out the stack.", "RollOutDone", time)
conditions.setCondition(v1.OperatorProgressing, v1.ConditionFalse, "", "", time)
conditions.setCondition(v1.OperatorDegraded, v1.ConditionFalse, "", "", time)
conditions.setCondition(v1.OperatorDegraded, v1.ConditionFalse, degradedConditionMessage, "", time)
Copy link
Contributor

Choose a reason for hiding this comment

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

We probably should set the actual condition here depending on the message passed?

Copy link
Contributor

Choose a reason for hiding this comment

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

Also this should add a reason. Maybe PrometheusNoDataPersistence or something like it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We probably should set the actual condition here depending on the message passed?

Do you mean we should set the condition to true when a message other than "" is passed?
I probably should have provided context in the PR description, the requirement is to actually keep the condition to degraded=false but set a message for cluster admins to be aware of the state. I update the PR description to contain that information.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also this should add a reason. Maybe PrometheusNoDataPersistence or something like it

Good point, added the reason as well.

Copy link
Contributor

Choose a reason for hiding this comment

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

Do you mean we should set the condition to true when a message other than "" is passed?

Yes that is the convention afaiu, at least in the other direction (don't set the condition without also setting a reason). To me it makes sense too, but I'll try to find some according docs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@wking we could not find any documentation on this particular topic. Is it okay for an operator to set a message for the degraded condition but keep the value to false. This is what we discussed for CMO when there is no persistent storage enabled to indicate to the admin that metrics might be lost.

Copy link
Contributor Author

@fpetkovski fpetkovski Jul 20, 2021

Choose a reason for hiding this comment

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

Based on Trevor's reply in slack, setting a message for the degraded condition while keeping the value to false is a valid state for the operator status. A good practice in these situations is to add a link to the documentation on how to fix the underlying problem.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jul 8, 2021

@fpetkovski: This pull request references Bugzilla bug 1978662, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.9.0) matches configured target release for branch (4.9.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

Requesting review from QA contact:
/cc @juzhao

In response to this:

Bug 1978662: Set a degraded message when persistent storage is not configured

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.

@fpetkovski fpetkovski force-pushed the indicate-no-storage branch from 740e370 to 9bc2b96 Compare July 8, 2021 12:12
@fpetkovski
Copy link
Contributor Author

fpetkovski commented Jul 8, 2021

@jan--f I agree that the workaround is not ideal, but also I think reworking the status reporting is a bit outside of the scope of what is requested from us in this BZ. I don't think introducing a func (r *StatusReporter) SetDegraded is really appropriate in this case because we need to set degraded to False and at the same time display message for the degraded condition.

What we might need is some sort of a status builder, or some other mechanism to decouple the status reporter from the status itself. Right now both the status state and the status update is handled through the same abstraction.

Do you know if we already have a ticket for reworking the status reporting? I would be more than happy to pair on that one and see how we can improve the current situation.

@openshift-ci openshift-ci bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 8, 2021
@jan--f
Copy link
Contributor

jan--f commented Jul 9, 2021

@jan--f I agree that the workaround is not ideal, but also I think reworking the status reporting is a bit outside of the scope of what is requested from us in this BZ. I don't think introducing a func (r *StatusReporter) SetDegraded is really appropriate in this case because we need to set degraded to False and at the same time display message for the degraded condition.

What we might need is some sort of a status builder, or some other mechanism to decouple the status reporter from the status itself. Right now both the status state and the status update is handled through the same abstraction.

Do you know if we already have a ticket for reworking the status reporting? I would be more than happy to pair on that one and see how we can improve the current situation.

I don't think we have an overarching ticket. But agreed, this is really not in scope for this ticket.

@simonpasquier
Copy link
Contributor

I don't find any ticket to rewrite the status reporter part but I agree that it can be improved (I presume that the code originates from times when the ClusterOperator semantics weren't well defined).

Copy link
Contributor

@arajkumar arajkumar left a comment

Choose a reason for hiding this comment

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

lgtm

@fpetkovski
Copy link
Contributor Author

/hold until we get confirmation from @wking

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 16, 2021
@fpetkovski fpetkovski force-pushed the indicate-no-storage branch from 9bc2b96 to f1ed7fb Compare July 19, 2021 07:09
@fpetkovski
Copy link
Contributor Author

/unhold

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 19, 2021
Copy link
Contributor

@arajkumar arajkumar left a comment

Choose a reason for hiding this comment

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

lgtm

@fpetkovski
Copy link
Contributor Author

/retest

1 similar comment
@fpetkovski
Copy link
Contributor Author

/retest

@simonpasquier
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jul 20, 2021
@fpetkovski fpetkovski force-pushed the indicate-no-storage branch from fed1807 to ca5f932 Compare July 20, 2021 08:20
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Jul 20, 2021
@fpetkovski fpetkovski requested a review from simonpasquier July 20, 2021 10:02
Copy link
Contributor

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

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jul 20, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jul 20, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: arajkumar, fpetkovski, simonpasquier

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

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [arajkumar,fpetkovski,simonpasquier]

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

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jul 20, 2021

@fpetkovski: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Rerun command
ci/prow/e2e-aws-single-node 9c7cddc link /test e2e-aws-single-node

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/test-infra repository. I understand the commands that are listed here.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

8 similar comments
@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit d5037c6 into openshift:master Jul 20, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jul 20, 2021

@fpetkovski: All pull requests linked via external trackers have merged:

Bugzilla bug 1978662 has been moved to the MODIFIED state.

In response to this:

Bug 1978662: Set a degraded message when persistent storage is not configured

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.

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. bugzilla/severity-medium Referenced Bugzilla bug's severity is medium for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants