Skip to content
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

gcloud-sqlproxy - Helm Chart hpa fails using autoscaling/v2 #134

Closed
ChristianGeie opened this issue Mar 28, 2023 · 5 comments · Fixed by #136
Closed

gcloud-sqlproxy - Helm Chart hpa fails using autoscaling/v2 #134

ChristianGeie opened this issue Mar 28, 2023 · 5 comments · Fixed by #136

Comments

@ChristianGeie
Copy link

Hello, in version 0.24.0 helmchart fails while applying hpa. For version 0.23.0 everything works well.

I see that between both version some changes regarding apiVersion happend, it was changed from autoscaling/v2beta1
to autoscaling/v2 which is fine, because v2beta1 is deprecated in 1.19 and no longer served as of 1.25.

autoscaling/v2 is available since 1.23, but has some breaking changes that are currently not reflected in the gcloud-sqlproxy chart.

I would like to suggest using autoscaling/v2beta2 to apply HorizontalPodAutoscaler ressource.

K8s: v1.23.14-gke.1800
Error while applying helm chart:

Helm upgrade failed: error validating "": error validating data: [ValidationError(HorizontalPodAutoscaler.spec.metrics[0].resource): unknown field "targe
tAverageUtilization" in io.k8s.api.autoscaling.v2.ResourceMetricSource, ValidationError(HorizontalPodAutoscaler.spec.metrics[0].resource): missing required field "target" in io.k8s
.api.autoscaling.v2.ResourceMetricSource]
@tomrk-esteam8
Copy link
Contributor

tomrk-esteam8 commented Mar 29, 2023

Hi, if I understand it correctly, there is an error in the way metrics are builded.

I mean: https://github.com/rimusz/charts/blame/master/stable/gcloud-sqlproxy/templates/horizontalpodautoscaler.yaml#L19-L29

 {{- if .Values.autoscaling.targetCPUUtilizationPercentage }}
    - type: Resource
      resource:
        name: cpu
        targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
    {{- end }}
    {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
    - type: Resource
      resource:
        name: memory
        targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}

when it should be sth like this:

https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#support-for-resource-metrics

type: Resource
resource:
  name: cpu
  target:
    type: Utilization
    averageUtilization: 60

I can try to fix it.

@rimusz
Copy link
Owner

rimusz commented Mar 29, 2023

@tomrk-esteam8 yes please :)

@ChristianGeie
Copy link
Author

@tomrk-esteam8 Do you want to simple switch to autoscaling/v2beta2 or do you want to use autoscaling/v2 furthermore and adapt the hpa template to it?

Please note that the api is only supported from v1.23 and the gcloud-sqlproxy helm chart will then become unusable for users who are still using an older kubernetes version.

@rimusz Are there any specifications as to which k8s version should be supported?

@tomrk-esteam8
Copy link
Contributor

tomrk-esteam8 commented Mar 29, 2023

@ChristianGeie I would stick with autoscaling/v2 as it is already switched and chart is unusable anyway at this point.

@ChristianGeie
Copy link
Author

@tomrk-esteam8 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants