Kubernetes-client: Scaling Policies

Created on 26 Jan 2020  路  3Comments  路  Source: fabric8io/kubernetes-client

I wanted to create a new horizontal pod autoscaler with a scaling policy via the api. But am i right there is actually no way to do this. Or is there a workaround?

https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#example-disable-scale-down

Most helpful comment

Although documentation clearly states this feature is in 1.17, as you can see in the source code, it's not available in the tagged release in GitHub.

1.17 tag:
No Behavior field available:
https://github.com/kubernetes/api/blob/d9adff57e763360b17e25cfe5a6c85f545c6daa2/autoscaling/v2beta2/types.go#L33

Master Branch:
New field Behavior in HorizontalPodAutoscalerSpec
https://github.com/kubernetes/api/blob/3d77e12e1dcdd9af6adcd33f85d62d9ff9c97292/autoscaling/v2beta2/types.go#L80

HorizontalPodAutoscalerBehavior:
https://github.com/kubernetes/api/blob/3d77e12e1dcdd9af6adcd33f85d62d9ff9c97292/autoscaling/v2beta2/types.go#L128-L142

Nonetheless I'll submit a PR with the update to v2beta2 so that our stays current.

All 3 comments

I think out HorizontalPodAutoscaler is pointing to v2beta1 right now
https://github.com/fabric8io/kubernetes-client/blob/cf186055d12925d5abf78d534db6c0f5618ecec9/kubernetes-model/cmd/generate/generate.go#L38

This feature is supported by v2beta2 apiGroup. We can modify this in model if it's fully backward compatible with v2beta1

Although documentation clearly states this feature is in 1.17, as you can see in the source code, it's not available in the tagged release in GitHub.

1.17 tag:
No Behavior field available:
https://github.com/kubernetes/api/blob/d9adff57e763360b17e25cfe5a6c85f545c6daa2/autoscaling/v2beta2/types.go#L33

Master Branch:
New field Behavior in HorizontalPodAutoscalerSpec
https://github.com/kubernetes/api/blob/3d77e12e1dcdd9af6adcd33f85d62d9ff9c97292/autoscaling/v2beta2/types.go#L80

HorizontalPodAutoscalerBehavior:
https://github.com/kubernetes/api/blob/3d77e12e1dcdd9af6adcd33f85d62d9ff9c97292/autoscaling/v2beta2/types.go#L128-L142

Nonetheless I'll submit a PR with the update to v2beta2 so that our stays current.

I think issue is fixed. Please try out on v4.8.0. Feel free to close this if you're facing any problems regarding this.

Was this page helpful?
0 / 5 - 0 ratings