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 1698562: status: introduce ingresscontroller degraded condition #283

Merged

Conversation

ironcladlou
Copy link
Contributor

Introduce degraded condition computation for ingresscontroller. For now,
degraded only considers failed deployments, which seems like a conservative bare
minimum indicator of a degraded state. Ensure that ingresscontroller deployments
have a useful progressDeadlineSeconds so that degraded deployments are actually
detected in a useful timeframe.

Refacor clusteroperator degraded status to account for ingresscontroller
degraded conditions.

Introduce degraded condition computation for ingresscontroller. For now,
degraded only considers failed deployments, which seems like a conservative bare
minimum indicator of a degraded state. Ensure that ingresscontroller deployments
have a useful progressDeadlineSeconds so that degraded deployments are actually
detected in a useful timeframe.

Refacor clusteroperator degraded status to account for ingresscontroller
degraded conditions.
@openshift-ci-robot openshift-ci-robot added the bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. label Aug 7, 2019
@openshift-ci-robot
Copy link
Contributor

@ironcladlou: This pull request references a valid Bugzilla bug. 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.

In response to this:

Bug 1698562: status: introduce ingresscontroller degraded condition

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-robot openshift-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Aug 7, 2019
@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 7, 2019
@@ -4,6 +4,7 @@ kind: Deployment
apiVersion: apps/v1
# name and namespace are set at runtime.
spec:
progressDeadlineSeconds: 120
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This might be too long, but 120 seems conservative and we can adjust if necessary.

@ironcladlou
Copy link
Contributor Author

Here's an example of the degraded condition on the ingresscontroller:

  - lastTransitionTime: "2019-08-07T15:05:03Z"
    message: 'The deployment failed (reason: ProgressDeadlineExceeded) with message:
      ReplicaSet "router-default-858c66c5c9" has timed out progressing.'
    reason: DeploymentFailed
    status: "True"
    type: Degraded

And here's the corresponding degraded condition on the clusteroperator:

  - lastTransitionTime: "2019-08-07T15:05:03Z"
    message: 'Some ingresscontrollers are degraded: default'
    reason: IngressControllersDegraded
    status: "True"
    type: Degraded

The ingresscontroller and operator are still available in this case because minimum deployment availability is maintained.

return operatorv1.OperatorCondition{
Type: operatorv1.OperatorStatusTypeDegraded,
Status: operatorv1.ConditionFalse,
Reason: "DeploymentAvailable",
Copy link
Contributor

Choose a reason for hiding this comment

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

DeploymentAvailable could be misleading if the deployment is still progressing and not available. Do we need an explicit reason when the degraded condition is false?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point, I removed the reason entirely

}

conditions := r.computeOperatorStatusConditions([]configv1.ClusterOperatorStatusCondition{},
namespace, tc.allIngressesAvailable, oldVersions, reportedVersions)
actual := computeOperatorProgressingCondition(tc.allIngressesAvailable, oldVersions, reportedVersions, tc.curVersions.operator, tc.curVersions.operand)
conditionsCmpOpts := []cmp.Option{
cmpopts.IgnoreFields(configv1.ClusterOperatorStatusCondition{}, "LastTransitionTime", "Reason", "Message"),
cmpopts.EquateEmpty(),
cmpopts.SortSlices(func(a, b configv1.ClusterOperatorStatusCondition) bool { return a.Type < b.Type }),
Copy link
Contributor

Choose a reason for hiding this comment

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

No longer need cmpopts.SortSlices or cmpopts.EquateEmpty.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@@ -4,6 +4,7 @@ kind: Deployment
apiVersion: apps/v1
# name and namespace are set at runtime.
spec:
progressDeadlineSeconds: 120
Copy link
Contributor

Choose a reason for hiding this comment

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

This reminds me that we need to set the readiness probe to use /healthz/ready. I'm nervous about setting the progressing deadline significantly lower than the default, especially if we start using /healthz/ready. Are we confident that the initial sync will finish in time on large clusters?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The default is 600 seconds, which seems too long. Do you agree? Would some e2e test warn us if we chose a value that's too short on average?

Copy link
Contributor

Choose a reason for hiding this comment

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

The default is 600 seconds, which seems too long. Do you agree?

That's what I'm wondering.

Would some e2e test warn us if we chose a value that's too short on average?

Not if the E2E tests are not representative of production clusters. Moreover, while we may be fine now, I intend to fix the readiness check to use /healthz/ready, which will cause the deployment not to be ready until the router has synched routes, which I could see taking more than 120 seconds on burdened clusters with many routes.

Copy link
Contributor

Choose a reason for hiding this comment

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

Progress deadline is usually measured in 10-20m.

Copy link
Contributor

Choose a reason for hiding this comment

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

This is way too low.

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're also not setting readiness endpoints correctly, fixing that and changing back to 10m in a followup.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nevermind, fixed here instead

type conditions struct {
degraded, progressing, available bool
}
func TestComputeOperatorProgressingCondition(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

So we're losing unit-test coverage of computeOperatorAvailableCondition and computeOperatorDegradedCondition, but I suppose they are sufficiently covered by E2E tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They currently seem simple enough that unit test coverage would be more code than it's worth given e2e, IMO.

If we start introducing additional inputs to the formulas, unit tests may become useful...

@Miciah
Copy link
Contributor

Miciah commented Aug 7, 2019

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Aug 7, 2019
@ironcladlou
Copy link
Contributor Author

Tests are still going, might as well roll the followups into this one.

/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 Aug 7, 2019
Set a more conservative deadline and use the correct readiness endpoint.
@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Aug 7, 2019
@ironcladlou
Copy link
Contributor Author

/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 Aug 7, 2019
@Miciah
Copy link
Contributor

Miciah commented Aug 7, 2019

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Aug 7, 2019
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ironcladlou, Miciah

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:

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

@openshift-bot
Copy link
Contributor

/retest

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

@openshift-merge-robot openshift-merge-robot merged commit df1eba3 into openshift:master Aug 7, 2019
@openshift-ci-robot
Copy link
Contributor

@ironcladlou: All pull requests linked via external trackers have merged. The Bugzilla bug has been moved to the MODIFIED state.

In response to this:

Bug 1698562: status: introduce ingresscontroller degraded condition

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

None yet

6 participants