-
Notifications
You must be signed in to change notification settings - Fork 54
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
Exposing scale subresource to enable HPA's to modify the replicas of Infinispan CR #2133
Conversation
Hi @ZeidH. Thanks for your PR. I'm waiting for a infinispan member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution @ZeidH, however we generate our CRD content from code, so it's not sufficient to update the static resource files.
Looking at the Artemis PR you linked on the issue, it seems like we can generate this by adding the following annotation above the Infinispan struct:
//+kubebuilder:subresource:scale:specpath=.spec.replicas,statuspath=.status.replicas
You should then be able to generate the static files by doing make generate
.
Thanks for the clear instructions @ryanemerson!, I'm rather new to this so appreciate the help. |
Thanks for updating @ZeidH. It seems like we need to increase our baseline go version in order to use that version of controller-gen. I have created a PR to baseline on 1.21 (1.20 is now EOL) and update the controller-gen version #2134. I'll let you know once that PR has been merged so that you can rebase this PR. |
I've tested the autoscaling with this setup:
and a
The Statefulset was able to scale from zero to n and back but I can imagine that for some configurations scaling to zero is not possible |
Apologies for the delay @ZeidH, but main is now baselined on go 1.21. Can you please rebase on the latest code? |
Can you explain which configurations you think would cause issues? |
a84d975
to
c35359e
Compare
This reverts commit da838d6.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @ZeidH, just a couple of minor comments and then I think we're good.
config/manifests/bases/infinispan-operator.clusterserviceversion.yaml
Outdated
Show resolved
Hide resolved
I can't think of any specific to Infinispan, the amount of available configurations is so immense it would take a long time to figure out what config can be autoscaled, and what cannot. I think after learning a bit on what Infinispan does the past few months, the configs where autoscaling doesn't work well also most likely wouldn't make much sense to use autoscaling/scale to zero, like clustered caches where you (almost)always want to have a hot instance. But from experience there can be issues with autoscaling when using specific types of storage configurations, or as @rigazilla mentioned in the GH Issue: about the operator sometimes needs to explicitly set the What we attempted to do is to dynamically scale a replicated cache with the amount of nodes (1 cache per node), essentially making Infinispan behave like a |
Thanks @ZeidH and sorry for the delay. I'll create a follow up PR with some documentation. Let me know if you need this feature soon via OLM and I can expedite the next release. |
Appreciate the feedback and the completion of this issue! It will help us greatly! We're not in a rush but we'd be very happy if this was released sometime in coming 2 weeks! |
@ZeidH 2.4.5 has been released now. |
Thank you @ryanemerson for the help! |
Enhanced the
spec.subresources
field for theInfinispan
CRD to map scalingThis enables APIs like the HorizontalPodAutoscaler and KEDA to modify the replica count of the Cache.