Using Kamaji together with Vertical Pod Autoscaler (VPA) #1257
Replies: 2 comments 2 replies
|
Hola Jose! I was working on something similar but with HPA via #366: by using a nil pointer on Deployment replicas, Kamaji doesn't set any value of the However, VPA is working on resource limits, and unfortunately we're hardcoding nil values and enforcing them: We can give it a try by removing those default values, but keep in mind we're just working at the PodSpec containers level: could this be enough for you in implementing a VPA? |
|
Hi Dario! I've tested the VPA scenario by installing the controller and creating a apiVersion: autoscaling.k8s.io/v1
kind: VerticalPodAutoscaler
metadata:
name: test-vpa
namespace: sare0000
spec:
targetRef:
apiVersion: "kamaji.clastix.io/v1alpha1"
kind: TenantControlPlane
name: ptf1234567
updatePolicy:
updateMode: "Recreate" # Off, Initial, Recreate, InPlaceOrRecreate, InPlaceThese are the recommedations and eviction events generated by the controller: Status:
Conditions:
Last Transition Time: 2026-07-30T06:31:25Z
Status: True
Type: RecommendationProvided
Observed Generation: 2
Recommendation:
Container Recommendations:
Container Name: konnectivity-server
Lower Bound:
Cpu: 9m
Memory: 50Mi
Target:
Cpu: 11m
Memory: 50Mi
Uncapped Target:
Cpu: 11m
Memory: 50Mi
Upper Bound:
Cpu: 619m
Memory: 1328430748
Container Name: kube-apiserver
Lower Bound:
Cpu: 20m
Memory: 244272298
Target:
Cpu: 23m
Memory: 297164212
Uncapped Target:
Cpu: 23m
Memory: 297164212
Upper Bound:
Cpu: 1972m
Memory: 16744946349
Container Name: kube-controller-manager
Lower Bound:
Cpu: 9m
Memory: 50Mi
Target:
Cpu: 11m
Memory: 63544758
Uncapped Target:
Cpu: 11m
Memory: 63544758
Upper Bound:
Cpu: 619m
Memory: 3580692157
Container Name: kube-scheduler
Lower Bound:
Cpu: 9m
Memory: 50Mi
Target:
Cpu: 11m
Memory: 50Mi
Uncapped Target:
Cpu: 11m
Memory: 50Mi
Upper Bound:
Cpu: 619m
Memory: 2042867346
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal EvictedPod 12m vpa-updater VPA Updater evicted Pod ptf1234567-847c97c985-8d8q4 to apply resource recommendation.
Normal EvictedPod 11m vpa-updater VPA Updater evicted Pod ptf1234567-847c97c985-7z5ql to apply resource recommendation.
Normal EvictedPod 10m vpa-updater VPA Updater evicted Pod ptf1234567-847c97c985-s8s2k to apply resource recommendation.PodSpecs were updated according to the changes requested by the VPA. Even after applying those changes, we haven't observed any issues or reconciliation loops with the Kamaji controller (I've left the service running for approximately one hour to verify that there are no repeated reconciliation cycles and that the values are not being overwritten). Based on these results, I think we can confirm that the VPA solution works as expected without requiring any changes to the CRDs spec or the reconciliation logic. |
Uh oh!
There was an error while loading. Please reload this page.
Hey!
I'm considering using Kamaji together with an external Vertical Pod Autoscaler (p.e. https://github.com/kubernetes/autoscaler/tree/master/vertical-pod-autoscaler)
The idea is to let the VPA automatically adjust the CPU and memory requests of the control plane components based on their actual resource usage over time. My question is related to how this external element could "disturb" the Kamaji controller behaviour. Since Kamaji manages the
Deploymentobject for the TCP components:Has anyone tried this approach, or is there a recommended way to combine Kamaji with a VPA/HPA solution?
Thank you for your time!
All reactions