Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.

Commit

Permalink
[stable/nextcloud] Add HPA (#22836)
Browse files Browse the repository at this point in the history
* [stable/nextcloud] Add HPA

Signed-off-by: Tom Koch <[email protected]>

* [stable/nextcloud] Bump chart version

Signed-off-by: Tom Koch <[email protected]>
  • Loading branch information
tomaaron authored Jun 17, 2020
1 parent 8ad6611 commit 65f4640
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 1 deletion.
2 changes: 1 addition & 1 deletion stable/nextcloud/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v1
name: nextcloud
version: 1.10.1
version: 1.11.0
appVersion: 17.0.0
description: A file sharing server that puts the control and security of your own data back into your hands.
keywords:
Expand Down
4 changes: 4 additions & 0 deletions stable/nextcloud/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@ The following table lists the configurable parameters of the nextcloud chart and
| `readinessProbe.timeoutSeconds` | When the probe times out | `5` |
| `readinessProbe.failureThreshold` | Minimum consecutive failures for the probe | `3` |
| `readinessProbe.successThreshold` | Minimum consecutive successes for the probe | `1` |
| `hpa.enabled` | Boolean to create a HorizontalPodAutoscaler | `false` |
| `hpa.cputhreshold` | CPU threshold percent for the HorizontalPodAutoscale | `60` |
| `hpa.minPods` | Min. pods for the Nextcloud HorizontalPodAutoscaler | `1` |
| `hpa.maxPods` | Max. pods for the Nextcloud HorizontalPodAutoscaler | `10` |
| `deploymentAnnotations` | Annotations to be added at 'deployment' level | not set |
| `podAnnotations` | Annotations to be added at 'pod' level | not set |

Expand Down
19 changes: 19 additions & 0 deletions stable/nextcloud/templates/hpa.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{{- if .Values.hpa.enabled -}}
apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
name: {{ template "nextcloud.fullname" . }}
labels:
app.kubernetes.io/name: {{ include "nextcloud.name" . }}
helm.sh/chart: {{ include "nextcloud.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
spec:
scaleTargetRef:
kind: Deployment
apiVersion: apps/v1
name: {{ template "nextcloud.fullname" . }}
minReplicas: {{ .Values.hpa.minPods }}
maxReplicas: {{ .Values.hpa.maxPods }}
targetCPUUtilizationPercentage: {{ .Values.hpa.cputhreshold }}
{{- end }}
9 changes: 9 additions & 0 deletions stable/nextcloud/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,15 @@ readinessProbe:
failureThreshold: 3
successThreshold: 1

## Enable pod autoscaling using HorizontalPodAutoscaler
## ref: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/
##
hpa:
enabled: false
cputhreshold: 60
minPods: 1
maxPods: 10

nodeSelector: {}

tolerations: []
Expand Down

0 comments on commit 65f4640

Please sign in to comment.