You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the HorizontalPodAutoscaler template hard-codes the value for apiVersion:
{{- if .Capabilities.APIVersions.Has "autoscaling/v2" }}
apiVersion: autoscaling/v2
{{- else if .Capabilities.APIVersions.Has "autoscaling/v2beta2" }}
apiVersion: autoscaling/v2beta2
{{- else }}
{{- fail "ERROR: You must have autoscaling/v2 or autoscaling/v2beta2 to use HorizontalPodAutoscaler" }}
{{- end }}
kind: HorizontalPodAutoscaler
We use ArgoCD to deploy our Helm charts, which does a helm teplate and then kubectl apply of the templates that are out of sync. As such we cannot rely on .Capabilites Helm object. Moreover, we are on a very old k8s version and so our HPA resource version is autoscaling/v1:
Would you accept a PR that modifies the IC Helm chart to enable templating in a value for this instead? Seems like a reasonable/good pattern in general because technically these templates having constraints for the k8s version and should be specifying that in the Chart.yaml anyway. By allowing chart users to specify apiVersion fields on all templates you can punt on having to evaluate those k8s API resource/version constraints in your Helm chart versioning.
Here is the proposed change to the template:
{{- if .Capabilities.APIVersions.Has "autoscaling/v2" }}
apiVersion: autoscaling/v2
{{- else if .Capabilities.APIVersions.Has "autoscaling/v2beta2" }}
apiVersion: autoscaling/v2beta2
{{- else if .Values.controller.autoscaling.apiVersion }}
apiVersion: {{ .Values.controller.autoscaling.apiVersion }}
{{- else }}
{{- fail "ERROR: You must have autoscaling/v2 or autoscaling/v2beta2 to use HorizontalPodAutoscaler" }}
{{- end }}
kind: HorizontalPodAutoscaler
The text was updated successfully, but these errors were encountered:
Sadly we don't support autoscaling/v1 any more due due to v1 having only CPU metrics (which is not really usable) and different autoscaling spec format. We will however fix .Capabilities.APIVersions probing in the next commit.
This commit fixes your issue in regards to ArgoCD not correctly filling out .Capabilities.APIVersions by checking K8s semver, so this should work in your case as long as you have fairly recent K8s with either autoscaling/v2 or autoscaling/v2beta2. Sadly, as we said, autoscaling/v1 is not going to be supported.
Currently the
HorizontalPodAutoscaler
template hard-codes the value forapiVersion
:We use ArgoCD to deploy our Helm charts, which does a
helm teplate
and thenkubectl apply
of the templates that are out of sync. As such we cannot rely on.Capabilites
Helm object. Moreover, we are on a very old k8s version and so our HPA resource version isautoscaling/v1
:Would you accept a PR that modifies the IC Helm chart to enable templating in a value for this instead? Seems like a reasonable/good pattern in general because technically these templates having constraints for the k8s version and should be specifying that in the
Chart.yaml
anyway. By allowing chart users to specifyapiVersion
fields on all templates you can punt on having to evaluate those k8s API resource/version constraints in your Helm chart versioning.Here is the proposed change to the template:
The text was updated successfully, but these errors were encountered: