-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Using HPA in version autoscaling/v1 might return unexpected results in kubectl #23196
Comments
cc @fgrzadkowski @mwielgus @kubernetes/autoscaling |
The referenced issue (#22431) points out that lots of clients will have usability issues if they are unable to show the user what percentage the controller is acting on from @danmcp:
from @jwforres:
|
On the other hand, defaults more complicated when multiple metrics are introduced -- now that we have alpha custom metrics, you don't want CPU autoscaling by default if you have custom metrics set. However, at the moment, custom metrics are specified via an annotation. In If you want to put the API-level default back in, we'd either have to elevate custom metrics to first-class citizens so that we could set the default for CPU only if no other metrics are specified (or attempt to check for the annotation value in the defaulting logic, which is probably not something that we want to do), or use a sentinel value to explicitly disable CPU autoscaling. IMO, the "CPU target percentage is a special field different from custom metrics" design that we currently have is suboptimal, but switching back to the original layout of all metrics being specified as |
@piosz -- status on this issue? Will it be fixed in 1.3? |
@roberthbailey once #26775 is merged we can close this. @DirectXMan12 I understand your concerns here. Not setting default to 80% was required to be able to scale only based on custom metrics (otherwise it would always scale based on cpu set by default to 80% + custom metrics). I think defining reasonable default policies and behaviors should be a part of extending HPA definition (which basically means moving forward with custom metrics feature). cc @jszczepkowski |
kubectl uses now hpa/v1 by default so closing the issue. |
In Kubernetes 1.2 HPA was graduated to GA, new types are available in
apiVersion: autoscaling/v1
.The previous version,apiVersion: extensions/v1beta1
, is still supported for backward compatibility. Also all Kubernetes core components in 1.2 still use objects inextensions/v1beta1
.In
extensions/v1beta1
ifCPUUtilization
inhorizontalPodAutoscalerSpec
was not specified it was set to80
by default while inautoscaling/v1
HPA object withouttargetCPUUtilizationPercentage
specified is a valid object. Pod autoscaler controller will apply a default scaling policy in this case which is equivalent to the previous one.Due to the way how defaults are applied (during the conversion between versions) if you create HPA object using
autoscaling/v1
API withouttargetCPUUtilizationPercentage
specified and read it using kubectl it will print default value as specified inextensions/v1beta1
despite the fact the field is empty.This should be fixed in 1.3 by migrating kubectl to use HPA in
autoscaling/v1
.ref #22431, #22449
The text was updated successfully, but these errors were encountered: