diff --git a/keda/README.md b/keda/README.md index 2137d65c..a289a5d5 100644 --- a/keda/README.md +++ b/keda/README.md @@ -109,6 +109,11 @@ their default values. | Parameter | Type | Default | Description | |-----------|------|---------|-------------| +| `autoscaling.verticalPodAutoscaler.keda.cpu.maxAllowed` | int | `2` | | +| `autoscaling.verticalPodAutoscaler.keda.cpu.minAllowed` | string | `"20m"` | | +| `autoscaling.verticalPodAutoscaler.keda.enabled` | bool | `false` | Enables the creation of a vpa for the keda-operator | +| `autoscaling.verticalPodAutoscaler.keda.memory.maxAllowed` | string | `"2Gi"` | | +| `autoscaling.verticalPodAutoscaler.keda.memory.minAllowed` | string | `"200Mi"` | | | `extraArgs.keda` | object | `{}` | Additional KEDA Operator container arguments | | `image.keda.repository` | string | `"ghcr.io/kedacore/keda"` | Image name of KEDA operator | | `image.keda.tag` | string | `""` | Image tag of KEDA operator. Optional, given app version of Helm chart is used by default | @@ -137,6 +142,11 @@ their default values. | Parameter | Type | Default | Description | |-----------|------|---------|-------------| +| `autoscaling.verticalPodAutoscaler.metricsApiServer.cpu.maxAllowed` | int | `2` | | +| `autoscaling.verticalPodAutoscaler.metricsApiServer.cpu.minAllowed` | string | `"20m"` | | +| `autoscaling.verticalPodAutoscaler.metricsApiServer.enabled` | bool | `false` | Enables the creation of a vpa for the keda-operator-metrics-apiserver | +| `autoscaling.verticalPodAutoscaler.metricsApiServer.memory.maxAllowed` | string | `"2Gi"` | | +| `autoscaling.verticalPodAutoscaler.metricsApiServer.memory.minAllowed` | string | `"200Mi"` | | | `extraArgs.metricsAdapter` | object | `{}` | Additional Metrics Adapter container arguments | | `image.metricsApiServer.repository` | string | `"ghcr.io/kedacore/keda-metrics-apiserver"` | Image name of KEDA Metrics API Server | | `image.metricsApiServer.tag` | string | `""` | Image tag of KEDA Metrics API Server. Optional, given app version of Helm chart is used by default | diff --git a/keda/templates/manager/verticalpodautoscaler.yaml b/keda/templates/manager/verticalpodautoscaler.yaml new file mode 100644 index 00000000..4e4e0293 --- /dev/null +++ b/keda/templates/manager/verticalpodautoscaler.yaml @@ -0,0 +1,30 @@ +{{- if .Values.autoscaling.verticalPodAutoscaler.keda.enabled }} +apiVersion: autoscaling.k8s.io/v1 +kind: VerticalPodAutoscaler +metadata: + name: {{ .Values.operator.name }}-vpa + namespace: {{ .Release.Namespace }} + annotations: + {{- toYaml .Values.additionalAnnotations | nindent 4 }} + labels: + {{- include "keda.labels" . | indent 4 }} +spec: + targetRef: + apiVersion: "apps/v1" + kind: Deployment + name: {{ .Values.operator.name }} + resourcePolicy: + containerPolicies: + - containerName: '*' + controlledResources: + - cpu + - memory + maxAllowed: + cpu: {{ .Values.autoscaling.verticalPodAutoscaler.keda.cpu.maxAllowed }} + memory: {{ .Values.autoscaling.verticalPodAutoscaler.keda.memory.maxAllowed }} + minAllowed: + cpu: {{ .Values.autoscaling.verticalPodAutoscaler.keda.cpu.minAllowed }} + memory: {{ .Values.autoscaling.verticalPodAutoscaler.keda.memory.minAllowed }} + updatePolicy: + updateMode: "Auto" +{{- end }} diff --git a/keda/templates/metrics-server/verticalpodautoscaler.yaml b/keda/templates/metrics-server/verticalpodautoscaler.yaml new file mode 100644 index 00000000..32bf5f9e --- /dev/null +++ b/keda/templates/metrics-server/verticalpodautoscaler.yaml @@ -0,0 +1,30 @@ +{{- if .Values.autoscaling.verticalPodAutoscaler.metricsApiServer.enabled }} +apiVersion: autoscaling.k8s.io/v1 +kind: VerticalPodAutoscaler +metadata: + name: {{ .Values.operator.name }}-metrics-apiserver-vpa + namespace: {{ .Release.Namespace }} + annotations: + {{- toYaml .Values.additionalAnnotations | nindent 4 }} + labels: + {{- include "keda.labels" . | indent 4 }} +spec: + targetRef: + apiVersion: "apps/v1" + kind: Deployment + name: {{ .Values.operator.name }}-metrics-apiserver + resourcePolicy: + containerPolicies: + - containerName: '*' + controlledResources: + - cpu + - memory + maxAllowed: + cpu: {{ .Values.autoscaling.verticalPodAutoscaler.metricsApiServer.cpu.maxAllowed }} + memory: {{ .Values.autoscaling.verticalPodAutoscaler.metricsApiServer.memory.maxAllowed }} + minAllowed: + cpu: {{ .Values.autoscaling.verticalPodAutoscaler.metricsApiServer.cpu.minAllowed }} + memory: {{ .Values.autoscaling.verticalPodAutoscaler.metricsApiServer.memory.minAllowed }} + updatePolicy: + updateMode: "Auto" +{{- end }} diff --git a/keda/values.yaml b/keda/values.yaml index e6441150..456161fb 100644 --- a/keda/values.yaml +++ b/keda/values.yaml @@ -24,6 +24,27 @@ image: # -- Kubernetes cluster domain clusterDomain: cluster.local +autoscaling: + verticalPodAutoscaler: + keda: + # -- Enables the creation of a vpa for the keda-operator + enabled: false + cpu: + minAllowed: 20m + maxAllowed: 2 + memory: + minAllowed: 200Mi + maxAllowed: 2Gi + metricsApiServer: + # -- Enables the creation of a vpa for the keda-operator-metrics-apiserver + enabled: false + cpu: + minAllowed: 20m + maxAllowed: 2 + memory: + minAllowed: 200Mi + maxAllowed: 2Gi + crds: # -- Defines whether the KEDA CRDs have to be installed or not. install: true