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-14383: disable autoscaler when no nodepool requires it #3846

Merged
merged 1 commit into from Apr 11, 2024

Conversation

sjenning
Copy link
Contributor

@sjenning sjenning commented Apr 5, 2024

Creates a new DisableClusterAutoscalerAnnotation set on the HostedControlPlane by the hypershift-operator when none of the NodePools for a particular HostedCluster have spec.autoScaling set. When this annotation is set on the HCP, the CPO sets replicas on the cluster-autoscaler Deployment to 0.

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 5, 2024
Copy link
Contributor

openshift-ci bot commented Apr 5, 2024

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@sjenning sjenning changed the title WIP: disable autoscaler when no nodepool require it WIP: disable autoscaler when no nodepool requires it Apr 5, 2024
@openshift-ci openshift-ci bot added area/ci-tooling Indicates the PR includes changes for CI or tooling area/cli Indicates the PR includes changes for CLI labels Apr 5, 2024
Copy link
Contributor

openshift-ci bot commented Apr 5, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sjenning

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 area/control-plane-operator Indicates the PR includes changes for the control plane operator - in an OCP release approved Indicates a PR has been approved by an approver from all required OWNERS files. area/documentation Indicates the PR includes changes for documentation area/hypershift-operator Indicates the PR includes changes for the hypershift operator and API - outside an OCP release and removed do-not-merge/needs-area labels Apr 5, 2024
Copy link

netlify bot commented Apr 5, 2024

Deploy Preview for hypershift-docs ready!

Name Link
🔨 Latest commit dc9b9e6
🔍 Latest deploy log https://app.netlify.com/sites/hypershift-docs/deploys/66140734ef56f70008d7fbc8
😎 Deploy Preview https://deploy-preview-3846--hypershift-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@sjenning sjenning changed the title WIP: disable autoscaler when no nodepool requires it disable autoscaler when no nodepool requires it Apr 8, 2024
@sjenning sjenning changed the title disable autoscaler when no nodepool requires it OCPBUGS-14383: disable autoscaler when no nodepool requires it Apr 8, 2024
@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 Apr 8, 2024
@openshift-ci-robot
Copy link

@sjenning: This pull request references Jira Issue OCPBUGS-14383, 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 New, which is one of the valid states (NEW, ASSIGNED, POST)

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

In response to this:

Creates a new DisableClusterAutoscalerAnnotation set on the HostedControlPlane by the hypershift-operator when none of the NodePools for a particular HostedCluster have spec.autoScaling set. When this annotation is set on the HCP, the CPO sets replicas on the cluster-autoscaler Deployment to 0.

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.

@sjenning sjenning marked this pull request as ready for review April 8, 2024 15:17
@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 Apr 8, 2024
@sjenning sjenning added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. and removed area/documentation Indicates the PR includes changes for documentation area/cli Indicates the PR includes changes for CLI area/ci-tooling Indicates the PR includes changes for CI or tooling labels Apr 8, 2024
@muraee
Copy link
Contributor

muraee commented Apr 8, 2024

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Apr 8, 2024
@sjenning
Copy link
Contributor Author

sjenning commented Apr 8, 2024

/retest

@enxebre
Copy link
Member

enxebre commented Apr 9, 2024

Thanks, this is good behavioural fix! fwiw instead of adding a new annotation we could let isAutoscalingNeeded within reconcileHostedControlPlane to set hcp.Spec.Autoscaling = hcluster.Spec.Autoscaling or not hcp.Spec.Autoscaling = nil, and let that be what dictates the deployment.spec.replicas. This might not be trivial though since hcp.spec.autoscaling is not a pointer. I'm fine with the annotation too.

@sjenning
Copy link
Contributor Author

sjenning commented Apr 9, 2024

/retest

1 similar comment
@sjenning
Copy link
Contributor Author

/retest

@sjenning sjenning removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 10, 2024
@sjenning
Copy link
Contributor Author

/test e2e-aws

1 similar comment
@sjenning
Copy link
Contributor Author

/test e2e-aws

@openshift-bot
Copy link

/retest-required

Remaining retests: 0 against base HEAD fabd790 and 2 for PR HEAD dc9b9e6 in total

@sjenning
Copy link
Contributor Author

/test e2e-aws

3 similar comments
@sjenning
Copy link
Contributor Author

/test e2e-aws

@sjenning
Copy link
Contributor Author

/test e2e-aws

@sjenning
Copy link
Contributor Author

/test e2e-aws

@sjenning
Copy link
Contributor Author

/override ci/prow/e2e-aws

Copy link
Contributor

openshift-ci bot commented Apr 11, 2024

@sjenning: Overrode contexts on behalf of sjenning: 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/test-infra repository.

Copy link
Contributor

openshift-ci bot commented Apr 11, 2024

@sjenning: all tests passed!

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-merge-bot openshift-merge-bot bot merged commit 537f81a into openshift:main Apr 11, 2024
12 of 14 checks passed
@openshift-bot
Copy link

@sjenning: Jira Issue OCPBUGS-14383: All pull requests linked via external trackers have merged:

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

In response to this:

Creates a new DisableClusterAutoscalerAnnotation set on the HostedControlPlane by the hypershift-operator when none of the NodePools for a particular HostedCluster have spec.autoScaling set. When this annotation is set on the HCP, the CPO sets replicas on the cluster-autoscaler Deployment to 0.

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.

@sjenning
Copy link
Contributor Author

/cherry-pick release-4.15

@openshift-cherrypick-robot

@sjenning: #3846 failed to apply on top of branch "release-4.15":

Applying: disable autoscaler when no nodepool require it
Using index info to reconstruct a base tree...
M	api/hypershift/v1beta1/hostedcluster_types.go
M	control-plane-operator/controllers/hostedcontrolplane/autoscaler/reconcile.go
M	hypershift-operator/controllers/hostedcluster/hostedcluster_controller.go
M	hypershift-operator/controllers/hostedcluster/hostedcluster_controller_test.go
A	vendor/github.com/openshift/hypershift/api/hypershift/v1beta1/hostedcluster_types.go
Falling back to patching base and 3-way merge...
Auto-merging hypershift-operator/controllers/hostedcluster/hostedcluster_controller_test.go
Auto-merging hypershift-operator/controllers/hostedcluster/hostedcluster_controller.go
CONFLICT (content): Merge conflict in hypershift-operator/controllers/hostedcluster/hostedcluster_controller.go
Auto-merging control-plane-operator/controllers/hostedcontrolplane/autoscaler/reconcile.go
Auto-merging api/hypershift/v1beta1/hostedcluster_types.go
CONFLICT (content): Merge conflict in api/hypershift/v1beta1/hostedcluster_types.go
Auto-merging api/hypershift/v1alpha1/hostedcluster_types.go
CONFLICT (content): Merge conflict in api/hypershift/v1alpha1/hostedcluster_types.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 disable autoscaler when no nodepool require it
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherry-pick release-4.15

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-merge-robot
Copy link
Contributor

Fix included in accepted release 4.16.0-0.nightly-2024-04-29-154406

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/control-plane-operator Indicates the PR includes changes for the control plane operator - in an OCP release area/hypershift-operator Indicates the PR includes changes for the hypershift operator and API - outside an OCP release 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.

None yet

7 participants