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

Add vpa crs for keda-operator and metrics-server #562

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions keda/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,11 @@ their default values.

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `autoscaling.verticalPodAutoscaler.keda.cpu.maxAllowed` | int | `2` | |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean I can get rid of this change in the PR as it will be automatically be run by the ci jobs ?

| `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 |
Expand Down Expand Up @@ -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 |
Expand Down
30 changes: 30 additions & 0 deletions keda/templates/manager/verticalpodautoscaler.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
30 changes: 30 additions & 0 deletions keda/templates/metrics-server/verticalpodautoscaler.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
21 changes: 21 additions & 0 deletions keda/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading