Skip to content

Commit

Permalink
HELM-39: Add Horizontal Scaling
Browse files Browse the repository at this point in the history
Signed-off-by: GridexX <arsene582@gmail.com>
  • Loading branch information
GridexX committed Aug 28, 2023
1 parent 1439bef commit ce1db32
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/xwiki/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
description: XWiki is a free wiki software platform written in Java with a design emphasis on extensibility. XWiki is an enterprise wiki. It includes WYSIWYG editing, OpenDocument based document import/export, semantic annotations and tagging, and advanced permissions management.
name: xwiki
version: 1.2.0-Beta.7
version: 1.2.0-Beta.8
type: application
keywords:
- xwiki
Expand Down
29 changes: 29 additions & 0 deletions charts/xwiki/templates/hpa.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{{- $fullName := include "xwiki.fullname" . -}}
{{- if .Values.autoscaling.enabled }}
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{ $fullName }}
labels:
{{- include "xwiki.labels" . | nindent 4 }}
spec:
scaleTargetRef:
{{- if .Values.workloadStateful }}
apiVersion: {{ include "common.capabilities.statefulset.apiVersion" . }}
kind: StatefulSet
{{- else }}
apiVersion: {{ include "common.capabilities.deployment.apiVersion" . }}
kind: Deployment
{{- end }}
name: {{ $fullName }}
minReplicas: {{ .Values.autoscaling.minReplicas }}
maxReplicas: {{ .Values.autoscaling.maxReplicas }}
{{- with .Values.autoscaling.metrics }}
metrics:
{{- toYaml .Values.autoscaling.metrics | nindent 6 }}
{{- end }}
{{- with .Values.autoscaling.status }}
status:
{{- toYaml . | nindent 2 }}
{{- end }}
{{- end }}
28 changes: 28 additions & 0 deletions charts/xwiki/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -335,3 +335,31 @@ logback:
# extraConfiguration: |
# <logger name="org.xwiki" level="debug"/>
# <logger name="com.xwiki" level="debug"/>

# Enable Autoscaling for the xwiki deployment/statefullSet:
# https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale-walkthrough/
autoscaling:
enabled: true
minReplicas: 1
maxReplicas: 3
# Custom metrics to trigger the Autoscaling
# https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale-walkthrough/#autoscaling-on-multiple-metrics-and-custom-metrics
metrics: {}
# - type: Resource
# resource:
# name: cpu
# target:
# type: Utilization
# averageUtilization: 50
status: {}
# observedGeneration: 1
# lastScaleTime: <some-time>
# currentReplicas: 1
# desiredReplicas: 1
# currentMetrics:
# - type: Resource
# resource:
# name: cpu
# current:
# averageUtilization: 0
# averageValue: 0

0 comments on commit ce1db32

Please sign in to comment.