Skip to content

Conversation

@benjackwhite
Copy link

@benjackwhite benjackwhite commented Nov 24, 2025

Adds support for the annotation autoscaling.keda.sh/paused-replicas: 'false'

This is particularly useful Argo users where you want to explicitly include the annotation in your git manifest, so that Argo can track it as a managed field and you can see the diff if someone manually modifies it (we do this a lot!).

Note that '' would have also been an option but that felt a little less explicit and potentially a breaking change (although I think if empty string is used the object fails anyways). As long as something can be set, it solves the underlying issue.

Checklist

Fixes #7263

@benjackwhite benjackwhite requested a review from a team as a code owner November 24, 2025 13:39
@github-actions
Copy link

Thank you for your contribution! 🙏

Please understand that we will do our best to review your PR and give you feedback as soon as possible, but please bear with us if it takes a little longer as expected.

While you are waiting, make sure to:

  • Add an entry in our changelog in alphabetical order and link related issue
  • Update the documentation, if needed
  • Add unit & e2e tests for your changes
  • GitHub checks are passing
  • Is the DCO check failing? Here is how you can fix DCO issues

Once the initial tests are successful, a KEDA member will ensure that the e2e tests are run. Once the e2e tests have been successfully completed, the PR may be merged at a later date. Please be patient.

Learn more about our contribution guide.

@keda-automation keda-automation requested a review from a team November 24, 2025 13:39
@snyk-io
Copy link

snyk-io bot commented Nov 24, 2025

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@benjackwhite benjackwhite force-pushed the feat/support-false-paused-replicas branch from e40276c to 35acbe9 Compare November 24, 2025 13:42
@rickbrouwer
Copy link
Member

rickbrouwer commented Nov 25, 2025

I understand what you're saying, but I personally don't support the word (boolean) false for paused replicas, because that's where the number of replicas expected is.
By allowing false, it might seem like you're also allowing true, and what's the action in that case?

If you have an incident, what value do you use for paused-replicas? Is it always 0? Or can it be a different value?

@benjackwhite
Copy link
Author

benjackwhite commented Nov 27, 2025

I understand what you're saying, but I personally don't support the word (boolean) false for paused replicas, because that's where the number of replicas expected is. By allowing false, it might seem like you're also allowing true, and what's the action in that case?

If you have an incident, what value do you use for paused-replicas? Is it always 0? Or can it be a different value?

Yeah I indicated in the issue that false might be better to be explicit versus empty string for example ''. The point is it has to be something that isn't just missing otherwise Argo can't detect drift. I have zero opinion on that so happy for you to just say "make it this" and I will do it :D

Our extension sets the value if we pause to whatever the user decides. Then unsetting just involves removing the value alltogether. The issue then is that you can end up in a state where you dont see that the app is out of sync due to what I described in the description.

@rickbrouwer
Copy link
Member

The documentation states the following:

Typically, either one or the other is being used given they serve a different purpose/scenario. However, if both paused and paused-replicas are set, KEDA will scale your current workload to the number specified count in paused-replicas and then pause autoscaling.

I almost think we should reverse this. That way, you can keep setting the paused-replicas, but with the additional annotation, indicate whether it should actually be paused or not. If someone changes that and also the paused itself, I think you'll get what you want.

However, this would be a kind of breaking change in behavior for people who both specify that pause should be false, but still want to pause via the paused-replicas.
I'm not sure why that choice was made, but there's probably a good reason :)

For now, if I had to choose a solution, I think I'd go with "". But I'm not making the decision alone; I'm curious to hear the @kedacore/keda-contributors opinions.

@benjackwhite
Copy link
Author

I almost think we should reverse this. That way, you can keep setting the paused-replicas, but with the additional annotation, indicate whether it should actually be paused or not. If someone changes that and also the paused itself, I think you'll get what you want.

I would fully agree with this. We actually built our tool at first assuming it worked the way you are proposing - one annotation determines the fixed value, the other determines if that fixed value should be used or not. This would be ideal and would solve it all but as you say would be a breaking change.

As I say, happy to make the change to support empty string instead if that is preferred. Will wait for some feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support paused-replicas annotation as empty string value

2 participants