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

OCPBUGS-33659: Improve resliency of size tagging when hostedcluster KAS down #4034

Merged
merged 1 commit into from
May 17, 2024

Conversation

csrwng
Copy link
Contributor

@csrwng csrwng commented May 14, 2024

What this PR does / why we need it:
When the kube apiserver of a hosted cluster is not available, the replica status of nodepools will not be accurate because the CAPI controllers can no longer get node counts from the API server. This commit improves the handling of this situation with 2 changes:

  • Switches to use .spec.replicas to determine node count of nodepools that do not have autoscaling turned on.
  • Once a hosted cluster has been tagged with a size, only if the kube apiserver of the hosted cluster is available is the hosted cluster allowed to move to a different size.

Which issue(s) this PR fixes (optional, use fixes #<issue_number>(, fixes #<issue_number>, ...) format, where issue_number might be a GitHub issue, or a Jira story:
Fixes #OCPBUGS-33659

Checklist

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.

@openshift-ci-robot openshift-ci-robot added jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. labels May 14, 2024
@openshift-ci-robot
Copy link

@csrwng: This pull request references Jira Issue OCPBUGS-33659, which is valid. The bug has been moved to the POST state.

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

No GitHub users were found matching the public email listed for the QA contact in Jira (jiezhao@redhat.com), skipping review request.

The bug has been updated to refer to the pull request using the external bug tracker.

In response to this:

What this PR does / why we need it:
When the kube apiserver of a hosted cluster is not available, the replica status of nodepools will not be accurate because the CAPI controllers can no longer get node counts from the API server. This commit improves the handling of this situation with 2 changes:

  • Switches to use .spec.replicas to determine node count of nodepools that do not have autoscaling turned on.
  • Once a hosted cluster has been tagged with a size, only if the kube apiserver of the hosted cluster is available is the hosted cluster allowed to move to a different size.

Which issue(s) this PR fixes (optional, use fixes #<issue_number>(, fixes #<issue_number>, ...) format, where issue_number might be a GitHub issue, or a Jira story:
Fixes #OCPBUGS-33659

Checklist

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.

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.

@openshift-ci openshift-ci bot added the area/hypershift-operator Indicates the PR includes changes for the hypershift operator and API - outside an OCP release label May 14, 2024
Copy link
Contributor

openshift-ci bot commented May 14, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: csrwng

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-ci openshift-ci bot added approved Indicates a PR has been approved by an approver from all required OWNERS files. and removed do-not-merge/needs-area labels May 14, 2024
if hccoReportsNodeCount {
nodeCountRequiresAPIServer = true
Copy link
Member

Choose a reason for hiding this comment

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

should we also let the HCCO to compute nodecount from the NodePools spec?
Even without facing this issue wouldn't that make sense from the autoscaling functionallity pov?
If so we could change existing hostedControlPlane.Status.NodeCount or maybe have a new one e.g. hostedControlPlane.Status.NodeCountIntent

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's harder (since the hcco now needs to be aware of nodepools or machinesets). Could we instead use the hcco count if the KAS is functional, otherwise fallback to the nodepool.spec count if no autoscaling is in use?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually scratch that. In the cases where we don't have nodepools, but nodes exist (IBM Cloud), falling back on the nodepools will give us the wrong answer.

@enxebre
Copy link
Member

enxebre commented May 15, 2024

Relates to kubernetes-sigs/cluster-api#10195

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 15, 2024
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 15, 2024
@csrwng csrwng force-pushed the unavailable_kas_sizetag branch 3 times, most recently from d3a91c1 to e411488 Compare May 15, 2024 19:04
Copy link
Contributor

@stevekuznetsov stevekuznetsov 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 May 15, 2024
@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD 97d244b and 2 for PR HEAD e411488 in total

@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD 82db100 and 1 for PR HEAD e411488 in total

@celebdor
Copy link
Contributor

/retest-required

@csrwng
Copy link
Contributor Author

csrwng commented May 16, 2024

/override ci/prow/e2e-kubevirt-aws-ovn

Copy link
Contributor

openshift-ci bot commented May 16, 2024

@csrwng: Overrode contexts on behalf of csrwng: ci/prow/e2e-kubevirt-aws-ovn

In response to this:

/override ci/prow/e2e-kubevirt-aws-ovn

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.

@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label May 16, 2024
When the kube apiserver of a hosted cluster is not available, the
replica status of nodepools will not be accurate because the CAPI
controllers can no longer get node counts from the API server. This
commit improves the handling of this situation with 2 changes:
- Switches to use .spec.replicas to determine node count of nodepools
  that do not have autoscaling turned on.
- Once a hosted cluster has been tagged with a size, only if the kube
  apiserver of the hosted cluster is available is the hosted cluster
  allowed to move to a different size.
Copy link
Contributor

@stevekuznetsov stevekuznetsov left a comment

Choose a reason for hiding this comment

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

/lgtm

@enxebre
Copy link
Member

enxebre commented May 16, 2024

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label May 16, 2024
@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD 8f0d792 and 2 for PR HEAD 001916e in total

@bryan-cox
Copy link
Member

/retest

@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD a492a9a and 1 for PR HEAD 001916e in total

@openshift-bot
Copy link

/jira refresh

The requirements for Jira bugs have changed (Jira issues linked to PRs on main branch need to target different OCP), recalculating validity.

@openshift-ci-robot openshift-ci-robot added the jira/severity-critical Referenced Jira bug's severity is critical for the branch this PR is targeting. label May 17, 2024
@openshift-ci-robot
Copy link

@openshift-bot: This pull request references Jira Issue OCPBUGS-33659, which is valid.

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

No GitHub users were found matching the public email listed for the QA contact in Jira (jiezhao@redhat.com), skipping review request.

In response to this:

/jira refresh

The requirements for Jira bugs have changed (Jira issues linked to PRs on main branch need to target different OCP), recalculating validity.

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.

@celebdor
Copy link
Contributor

/retest-required

@csrwng
Copy link
Contributor Author

csrwng commented May 17, 2024

/override ci/prow/e2e-aws

@csrwng
Copy link
Contributor Author

csrwng commented May 17, 2024

/override ci/prow/e2e-kubevirt-aws-ovn

@csrwng
Copy link
Contributor Author

csrwng commented May 17, 2024

CI is currently flaking on cloud quota issues, and this PR does not impact any codepath tested by CI

Copy link
Contributor

openshift-ci bot commented May 17, 2024

@csrwng: Overrode contexts on behalf of csrwng: ci/prow/e2e-aws

In response to this:

/override ci/prow/e2e-aws

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.

Copy link
Contributor

openshift-ci bot commented May 17, 2024

@csrwng: Overrode contexts on behalf of csrwng: ci/prow/e2e-kubevirt-aws-ovn

In response to this:

/override ci/prow/e2e-kubevirt-aws-ovn

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.

Copy link
Contributor

openshift-ci bot commented May 17, 2024

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

Test name Commit Details Required Rerun command
ci/prow/e2e-azure 001916e link false /test e2e-azure

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.

@openshift-merge-bot openshift-merge-bot bot merged commit 630c4d8 into openshift:main May 17, 2024
12 of 13 checks passed
@openshift-ci-robot
Copy link

@csrwng: Jira Issue OCPBUGS-33659: All pull requests linked via external trackers have merged:

Jira Issue OCPBUGS-33659 has been moved to the MODIFIED state.

In response to this:

What this PR does / why we need it:
When the kube apiserver of a hosted cluster is not available, the replica status of nodepools will not be accurate because the CAPI controllers can no longer get node counts from the API server. This commit improves the handling of this situation with 2 changes:

  • Switches to use .spec.replicas to determine node count of nodepools that do not have autoscaling turned on.
  • Once a hosted cluster has been tagged with a size, only if the kube apiserver of the hosted cluster is available is the hosted cluster allowed to move to a different size.

Which issue(s) this PR fixes (optional, use fixes #<issue_number>(, fixes #<issue_number>, ...) format, where issue_number might be a GitHub issue, or a Jira story:
Fixes #OCPBUGS-33659

Checklist

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.

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.

@openshift-bot
Copy link

[ART PR BUILD NOTIFIER]

This PR has been included in build ose-hypershift-container-v4.17.0-202405171741.p0.g630c4d8.assembly.stream.el9 for distgit hypershift.
All builds following this will include this PR.

@csrwng csrwng deleted the unavailable_kas_sizetag branch July 12, 2024 15:56
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. area/hypershift-operator Indicates the PR includes changes for the hypershift operator and API - outside an OCP release jira/severity-critical Referenced Jira bug's severity is critical for the branch this PR is targeting. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants