devops-ia / helm-charts

devops-ia/helm-charts
https://devops-ia.github.io/helm-charts/
MIT License
4 stars 3 forks source link

Fix HPA template API v2 #55

Closed iredko-procore closed 5 months ago

iredko-procore commented 5 months ago

What this PR does / why we need it:

Current HPA implementation doesn't work and fails with the following error:

W0529 19:27:49.287601  108306 warnings.go:70] unknown field "spec.metrics[1].resource.targetAverageUtilization"
Error: UPGRADE FAILED: failed to create resource: HorizontalPodAutoscaler.autoscaling "cti-opencti-worker" is invalid: [spec.metrics[0].resource.target.type: Required value: must specify a metric target type, spec.metrics[0].resource.target.type: Invalid value: "": must be either Utilization, Value, or AverageValue, spec.metrics[0].resource.target.averageUtilization: Required value: must set either a target raw value or a target utilization, spec.metrics[1].resource.target.type: Required value: must specify a metric target type, spec.metrics[1].resource.target.type: Invalid value: "": must be either Utilization, Value, or AverageValue, spec.metrics[1].resource.target.averageUtilization: Required value: must set either a target raw value or a target utilization]

This PR updates workers HPA accordingly to the Kubernetes official docs.

Which issue this PR fixes

(optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged)

Special notes for your reviewer:

Checklist

ialejandro commented 5 months ago

Thanks a lot! I added on server too.