Skip to content

Conversation

@moritzrinow
Copy link
Contributor

@moritzrinow moritzrinow commented Sep 8, 2025

This PR addresses #409 and adds the possibility to selectively disable auto-scaling via annotations on Kubernetes.

Annotations:

  • mc-router.itzg.me/autoScaleUp for controlling scale-up
  • mc-router.itzg.me/autoScaleDown for controller scale-down

As mentioned, it is currently only possible to opt-out of auto-scaling, as the configuration flags --auto-scale-up and --auto-scale-down decide whether or not the actual watcher service is being instantiated or not. However, the piece of logic I added should also work for opt-in if it is being called.

I chose the annotations to work on Service rather than StatefulSet because the service seems like the main abstraction for the server configuration and the stateful-set is only the backend.

@itzg unfortunately I had to migrate the version of package golang.ngrok.com/ngrok down to v1.12.1 because I was not able to build for v1.13.0. It was complaining that this rev does not exist anymore. I checked the Github repo and it does indeed not exist.

@moritzrinow
Copy link
Contributor Author

Technically with this, you can somewhat opt-in to auto-scaling if one of the two (scale-up or scale-down) is enabled via flag.
Example:
One can use the annotation mc-router.itzg.me/autoScaleUp=true to opt-in to auto scale-up if the flag --auto-scale-down was provided, since the watcher is active then.

Copy link
Owner

@itzg itzg left a comment

Choose a reason for hiding this comment

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

Thanks!

@itzg itzg merged commit d0fcb93 into itzg:master Sep 10, 2025
2 checks passed
@itzg
Copy link
Owner

itzg commented Sep 10, 2025

Released in https://github.com/itzg/mc-router/releases/tag/v1.36.0

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.

2 participants