-
Notifications
You must be signed in to change notification settings - Fork 38
Closed
Description
I have tried to enable horizontal pod autoscaling, but discovered that the version Kubernetes I use does not support the autoscaling object generated by the helm chart.
Error: unable to build kubernetes objects from release manifest: [resource mapping not found for name: "chainloop-zaibon-cas" namespace: "" from "": no matches for kind "HorizontalPodAutoscaler" in version "autoscaling/v2beta1"
│ ensure CRDs are installed first, resource mapping not found for name: "chainloop-zaibon-controlplane" namespace: "" from "": no matches for kind "HorizontalPodAutoscaler" in version "autoscaling/v2beta1"
│ ensure CRDs are installed first]
The version used by the helm chart is v2beta1
, but the stable version of this crd is available in v2
.
I've tried to apply this patch and it appears to solve the problem for my Kubernetes version.
diff --git a/deployment/chainloop/templates/controlplane/hpa.yaml b/deployment/chainloop/templates/controlplane/hpa.yaml
index 8e7e520..06af614 100644
--- a/deployment/chainloop/templates/controlplane/hpa.yaml
+++ b/deployment/chainloop/templates/controlplane/hpa.yaml
@@ -1,5 +1,5 @@
{{- if .Values.controlplane.autoscaling.enabled }}
-apiVersion: autoscaling/v2beta1
+apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "chainloop.controlplane.fullname" . }}
@@ -17,12 +17,16 @@ spec:
- type: Resource
resource:
name: cpu
- targetAverageUtilization: {{ .Values.controlplane.autoscaling.targetCPUUtilizationPercentage }}
+ target:
+ type: Utilization
+ averageUtilization: {{ .Values.controlplane.autoscaling.targetCPUUtilizationPercentage }}
{{- end }}
{{- if .Values.controlplane.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
- targetAverageUtilization: {{ .Values.controlplane.autoscaling.targetMemoryUtilizationPercentage }}
+ target:
+ type: Utilization
+ averageUtilization: {{ .Values.controlplane.autoscaling.targetMemoryUtilizationPercentage }}
{{- end }}
{{- end }}
Metadata
Metadata
Assignees
Labels
No labels