Skip to content

Commit

Permalink
add vpa crs for keda-operator and metrics-server
Browse files Browse the repository at this point in the history
Signed-off-by: QuantumEnigmaa <[email protected]>
  • Loading branch information
QuantumEnigmaa committed Nov 9, 2023
1 parent 56f161c commit 3f9c812
Show file tree
Hide file tree
Showing 11 changed files with 188 additions and 74 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ $ helm repo add kedacore https://kedacore.github.io/charts
$ helm search repo kedacore
NAME CHART VERSION APP VERSION DESCRIPTION
kedacore/external-scaler-azure-cosmos-db 0.1.0 0.1.0 Event-based autoscaler for Azure Cosmos DB chan...
kedacore/keda 2.12.0 2.12.0 Event-based autoscaler for workloads on Kubernetes
kedacore/keda 2.13.0 2.12.0 Event-based autoscaler for workloads on Kubernetes
kedacore/keda-add-ons-http 0.6.0 0.6.0 Event-based autoscaler for HTTP workloads on Ku...
```

Expand Down
Binary file modified docs/external-scaler-azure-cosmos-db-0.1.0.tgz
Binary file not shown.
166 changes: 95 additions & 71 deletions docs/index.yaml

Large diffs are not rendered by default.

Binary file added docs/keda-2.13.0.tgz
Binary file not shown.
Binary file modified docs/keda-add-ons-http-0.6.0.tgz
Binary file not shown.
2 changes: 1 addition & 1 deletion keda/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ kubeVersion: ">=v1.23.0-0"

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
version: 2.12.0
version: 2.13.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application.
Expand Down
10 changes: 10 additions & 0 deletions keda/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,11 @@ their default values.
| `securityContext.operator` | object | [See below](#KEDA-is-secure-by-default) | [Security context] of the operator container |
| `topologySpreadConstraints.operator` | list | `[]` | [Pod Topology Constraints] of KEDA operator pod |
| `upgradeStrategy.operator` | object | `{}` | Capability to configure [Deployment upgrade strategy] for operator |
| `verticalPodAutoscaler.keda.cpu.maxAllowed` | int | `2` | |
| `verticalPodAutoscaler.keda.cpu.minAllowed` | string | `"20m"` | |
| `verticalPodAutoscaler.keda.enabled` | bool | `true` | Enables the creation of a vpa for the keda-operator |
| `verticalPodAutoscaler.keda.memory.maxAllowed` | string | `"2Gi"` | |
| `verticalPodAutoscaler.keda.memory.minAllowed` | string | `"200Mi"` | |
| `volumes.keda.extraVolumeMounts` | list | `[]` | Extra volume mounts for KEDA deployment |
| `volumes.keda.extraVolumes` | list | `[]` | Extra volumes for KEDA deployment |

Expand Down Expand Up @@ -162,6 +167,11 @@ their default values.
| `service.type` | string | `"ClusterIP"` | KEDA Metric Server service type |
| `topologySpreadConstraints.metricsServer` | list | `[]` | [Pod Topology Constraints] of KEDA metrics apiserver pod |
| `upgradeStrategy.metricsApiServer` | object | `{}` | Capability to configure [Deployment upgrade strategy] for Metrics Api Server |
| `verticalPodAutoscaler.metricsApiServer.cpu.maxAllowed` | int | `2` | |
| `verticalPodAutoscaler.metricsApiServer.cpu.minAllowed` | string | `"20m"` | |
| `verticalPodAutoscaler.metricsApiServer.enabled` | bool | `true` | Enables the creation of a vpa for the keda-operator-metrics-apiserver |
| `verticalPodAutoscaler.metricsApiServer.memory.maxAllowed` | string | `"2Gi"` | |
| `verticalPodAutoscaler.metricsApiServer.memory.minAllowed` | string | `"200Mi"` | |
| `volumes.metricsApiServer.extraVolumeMounts` | list | `[]` | Extra volume mounts for metric server deployment |
| `volumes.metricsApiServer.extraVolumes` | list | `[]` | Extra volumes for metric server deployment |

Expand Down
2 changes: 1 addition & 1 deletion keda/templates/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ WARNING - prometheus.webhooks.serviceMonitor.relabellings is deprecated, please

{{- if lt .Capabilities.KubeVersion.Minor "26" }}
-------------------------------------------------------------------------------------
WARNING - Running on unsupported Kubernetes version "1.{{.Capabilities.KubeVersion.Minor}}". KEDA 2.12 is supported and tested on Kubernetes "1.26" or higher. See https://keda.sh/docs/2.12/operate/cluster/ for details.
WARNING - Running on unsupported Kubernetes version "1.{{.Capabilities.KubeVersion.Minor}}". KEDA 2.13 is supported and tested on Kubernetes "1.26" or higher. See https://keda.sh/docs/2.13/operate/cluster/ for details.
-------------------------------------------------------------------------------------
{{- end }}

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.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.verticalPodAutoscaler.keda.cpu.maxAllowed }}
memory: {{ .Values.verticalPodAutoscaler.keda.memory.maxAllowed }}
minAllowed:
cpu: {{ .Values.verticalPodAutoscaler.keda.cpu.minAllowed }}
memory: {{ .Values.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.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.verticalPodAutoscaler.metricsApiServer.cpu.maxAllowed }}
memory: {{ .Values.verticalPodAutoscaler.metricsApiServer.memory.maxAllowed }}
minAllowed:
cpu: {{ .Values.verticalPodAutoscaler.metricsApiServer.cpu.minAllowed }}
memory: {{ .Values.verticalPodAutoscaler.metricsApiServer.memory.minAllowed }}
updatePolicy:
updateMode: "Auto"
{{- end }}
20 changes: 20 additions & 0 deletions keda/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,26 @@ image:
# -- Kubernetes cluster domain
clusterDomain: cluster.local

verticalPodAutoscaler:
keda:
# -- Enables the creation of a vpa for the keda-operator
enabled: true
cpu:
minAllowed: 20m
maxAllowed: 2
memory:
minAllowed: 200Mi
maxAllowed: 2Gi
metricsApiServer:
# -- Enables the creation of a vpa for the keda-operator-metrics-apiserver
enabled: true
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

0 comments on commit 3f9c812

Please sign in to comment.