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

Manually scale Pod Autoscaler of a revision #15480

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

saileshd1402
Copy link

@saileshd1402 saileshd1402 commented Aug 22, 2024

Proposed Changes

Update revision resource reconciler such that change in Revision annotations are reflected in it's Pod Autoscaler. With this change, we will be able to manually set the min-scale/max-scale of a PA by updating the annotations of a revision.

This will give us more control to manually scale up and down pods of a revision if needed.

Example:
Edit the annotations autoscaling.knative.dev/max-scale and autoscaling.knative.dev/min-scale of revision to update the Pod Autoscaler as well

@knative-prow knative-prow bot requested a review from izabelacg August 22, 2024 16:47
Copy link

knative-prow bot commented Aug 22, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: saileshd1402
Once this PR has been reviewed and has the lgtm label, please assign davidhadas for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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

@knative-prow knative-prow bot requested a review from ReToCode August 22, 2024 16:47
Copy link

linux-foundation-easycla bot commented Aug 22, 2024

CLA Signed


The committers listed above are authorized under a signed CLA.

Copy link

knative-prow bot commented Aug 22, 2024

Welcome @saileshd1402! It looks like this is your first PR to knative/serving 🎉

@knative-prow knative-prow bot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Aug 22, 2024
Copy link

knative-prow bot commented Aug 22, 2024

Hi @saileshd1402. Thanks for your PR.

I'm waiting for a knative member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

if !equality.Semantic.DeepEqual(tmpl.Spec, pa.Spec) {
diff, _ := kmp.SafeDiff(tmpl.Spec, pa.Spec) // Can't realistically fail on PASpec.
logger.Infof("PA %s needs reconciliation, diff(-want,+got):\n%s", pa.Name, diff)
if !equality.Semantic.DeepEqual(tmpl.Spec, pa.Spec) || !equality.Semantic.DeepEqual(tmpl.Annotations, pa.Annotations) {
Copy link
Contributor

@skonto skonto Sep 25, 2024

Choose a reason for hiding this comment

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

Hi @saileshd1402 I suppose you want to avoid creating a new revision, what is the use case you have? Could you describe the problem that you have?

Copy link
Author

Choose a reason for hiding this comment

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

Hi @skonto, essentially we are facing issues with manually scaling/updating replicaset. By default when we change scale, knative-serving brings up the pods associated with the new revision, wait for them to be active then scales down the previous revision. This doesn't work for on prem scenarios since there are fixed limited resources especially when dealing with GPUs so the new revision never gets ready.

Copy link
Contributor

@skonto skonto Oct 3, 2024

Choose a reason for hiding this comment

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

Hi @saileshd1402 this is something https://github.com/knative-extensions/serving-progressive-rollout tries to address. You can ask @houshengbo on this one, they are facing the same in their org. Vincent maintains the extension and has some ideas on the topic.

Copy link
Author

Choose a reason for hiding this comment

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

We did try using progressive rollout extension but it had it's own issues we faced:

  1. Can there be an approach to terminate the last pod of the previous revision when most pods of new revision is up knative-extensions/serving-progressive-rollout#200
  2. With the resourceUtil strategy, graceful traffic transfer does not occur during consecutive update requests. knative-extensions/serving-progressive-rollout#202
  3. With the resourceUtil strategy, traffic transfer does not occur during an update when deployment hits quota limit knative-extensions/serving-progressive-rollout#203

In a brief summary, we have noticed that the "resourceUtil" strategy fails to do graceful traffic transfer during consecutive updates, particularly when resource limits are hit. This leads to stuck states and failed requests, as traffic may still continue to direct to terminated revisions while new pods remain in pending state.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants