-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Bring KSM autoscaler addon up to standards #1524
Comments
I agree, the autoscaler deployment code is not in the right state and should be refactored. To make UX even better we would also need:
Few notes and suggestions to the proposal inline:
Mixing addon settings with components settings is something that should be avoided to have a clean separation of duty. If
Maybe we should convert autoscaler into an intermediary component (like kube-rbac-proxy) instead and allow managing not only KSM? We could potentially apply VPA to prometheus, if that even makes sense 😄
If autoscaler would be a part of a component, we could start tracking version in our auto-updater script - https://github.com/prometheus-operator/kube-prometheus/blob/main/scripts/generate-versions.sh It looks to me like the autoscaler should be a top-level component and not just an addon. However, its relation with KSM is a bit similar to the one between prometheus-operator and prometheus and it is not crucial to KSM operations. Due to this, I am not convinced autoscaler should live in KSM component, but I do think it should still be a component instead of an addon. With enough thought we could make autoscaler component to be generic enough to allow using it for managing resources of other components (maybe blackbox_exporter, maybe prometheus,...) Potentially something like the following could be used to implement the autoscaler component and use not only for KSM:
|
In my view, the add-on can behave like a patch to a component. Most add-ons seem to be this way currently. I think I will follow my idea on this point when opening the PR, and if you still do not like it when it is all put together, moving it from one file to the other should not be hard.
The autoscaler is more tightly couple with KSM, it needs to know the deployment name and its namespace directly in its arguments
Maybe as a later consideration? I can look into incorporating some documentation with the change. Please let me know if you are satisfied with the scope, and I'll open a tentative PR. |
Worth noting KSM has an experimental feature for sharding1, so I am think about renaming the addon to Footnotes |
Yes, that is what we aim for, but the patch cannot implement new configuration fields. This proposal instead mixes the configuration parameters of an addon and component. Such an approach is already proven to cause problems for other users. Additionally, since it is conditionally adding parameters, it prevents us from implementing a stable interface for passing configuration (WIP in #1477).
You may not use it but it doesn't mean the project is not shipping it. As such we need to consider a broader picture and not only partial solutions.
Changing resources of StatefulSet shouldn't cause downtime for the whole prometheus service and you should have at least one replica running at all times. Plus Prometheus StatefulSet implements And if something from what I described doesn't work as mentioned, it is a bug in prometheus-operator (or possibly in kubernetes StatefuleSet controller).
In the case of HPA we do have a tight coupling as KSM needs to be configured differently to allow HPA to work (KSM needs to be deployed as StatefulSet and needs to have 2 CLI flags set). However in the case of VPA we don't need to do anything with KSM Deployment, but we only need to notify VPA what is the target it is managing. As such VPA implementation is NOT coupled with KSM (it is coupled with kubernetes) and I don't see any reason we need to have this as an addon when we clearly can create a component out of it and use it also for other purposes. Bear in mind that managed deployment name and namespace can be easily passed as part of component options ( In the case of HPA, I would require it to be a part of the KSM component due to different provisioning mechanisms depending on the enablement of the sharding feature. |
What is missing?
This is about refactoring
ksm-autoscaler.libsonnet
into following standard and being well integrated with the KSM component, as well as adding more flexibility into its configuration.Here are my enhancement suggestions:
$.values.clusterVerticalAutoscaler
to$.values.kubeStateMetrics.autoscaler
$.ksmAutoscaler.<resource>
to$.kubeStateMetrics.autoscaler<resource>
(when the addon is enabled, resources are automatically in the loop to deploy ksm resources)image
,commonLabels
,selectorLabels
,resources
...ksm._config.name
as prefix for resource namesvalues
field withstd.manifestJsonEx()
, allowing full flexibility (core or node steps, sidecar auto-scaling...)kube-rbac-proxy-main
resources
to avoid downscaling when applying manifestextensions
API groupOf course, many of these changes would be breaking, I would bundle them all at once.
Why do we need it?
Provide a clean add-on experience
Anything else we need to know?:
The text was updated successfully, but these errors were encountered: