Skip to content

Commit

Permalink
Add back the horizontal pod autoscaler to zitadel
Browse files Browse the repository at this point in the history
  • Loading branch information
roman-aleksejuk-telia committed Jun 13, 2024
1 parent 0ba03b6 commit a4bbc80
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 1 deletion.
37 changes: 37 additions & 0 deletions charts/zitadel/templates/hpa.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{{- if .Values.autoscaling.enabled }}
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "zitadel.fullname" . }}
labels:
{{- include "zitadel.labels" . | nindent 4 }}
app.kubernetes.io/component: hpa
{{- with .Values.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ include "zitadel.fullname" . }}
minReplicas: {{ .Values.autoscaling.minReplicas }}
maxReplicas: {{ .Values.autoscaling.maxReplicas }}
metrics:
{{- if .Values.autoscaling.targetCPU }}
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: {{ .Values.autoscaling.targetCPU }}
{{- end }}
{{- if .Values.autoscaling.targetMemory }}
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: {{ .Values.autoscaling.targetMemory }}
{{- end }}
{{- end }}
9 changes: 8 additions & 1 deletion charts/zitadel/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -234,4 +234,11 @@ pdb:
annotations: {}

networkPolicies:
enabled: true
enabled: true

autoscaling:
enabled: true
minReplicas: 3
maxReplicas: 11
targetCPU: 80
targetMemory: 80

0 comments on commit a4bbc80

Please sign in to comment.