Skip to content

Commit

Permalink
add PVC and volume mount for plugins directory (#108)
Browse files Browse the repository at this point in the history
* add PVC and volume mount for plugins directory

* chart version bump

* Bump chart version
  • Loading branch information
agusl88 authored and stylianosrigas committed Oct 2, 2019
1 parent f0a7186 commit ea3beef
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/mattermost-team-edition/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
description: Mattermost Team Edition server.
name: mattermost-team-edition
version: 3.6.2
version: 3.7.0
appVersion: 5.13.2
keywords:
- mattermost
Expand Down
13 changes: 13 additions & 0 deletions charts/mattermost-team-edition/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ spec:
subPath: config.json
- mountPath: /mattermost/data
name: mattermost-data
- mountPath: /mattermost/{{ trimPrefix "./" .Values.configJSON.PluginSettings.Directory }}
name: mattermost-plugins
resources:
{{- .Values.resources | toYaml | nindent 12 }}
volumes:
Expand All @@ -86,3 +88,14 @@ spec:
{{ else }}
emptyDir: {}
{{ end }}
- name: mattermost-plugins
{{ if .Values.persistence.plugins.enabled }}
persistentVolumeClaim:
{{ if .Values.persistence.plugins.existingClaim }}
claimName: {{.Values.persistence.data.existingClaim }}
{{ else }}
claimName: {{ default (include "mattermost-team-edition.fullname" .) }}-plugins
{{ end }}
{{ else }}
emptyDir: {}
{{ end }}
28 changes: 28 additions & 0 deletions charts/mattermost-team-edition/templates/pvc-plugins.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{{- if and .Values.persistence.plugins.enabled (not .Values.persistence.plugins.existingClaim) -}}
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: {{ include "mattermost-team-edition.fullname" . }}-plugins
labels:
app.kubernetes.io/name: {{ include "mattermost-team-edition.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
helm.sh/chart: {{ include "mattermost-team-edition.chart" . }}
annotations:
{{- range $key, $value := .Values.persistence.plugins.annotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
spec:
accessModes:
- {{ .Values.persistence.plugins.accessMode | quote }}
resources:
requests:
storage: {{ .Values.persistence.plugins.size | quote }}
{{- if .Values.persistence.plugins.storageClass }}
{{- if (eq "-" .Values.persistence.plugins.storageClass) }}
storageClassName: ""
{{- else }}
storageClassName: "{{ .Values.persistence.plugins.storageClass }}"
{{- end }}
{{- end }}
{{- end }}
9 changes: 9 additions & 0 deletions charts/mattermost-team-edition/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,15 @@ persistence:
# storageClass:
accessMode: ReadWriteOnce
# existingClaim: ""
plugins:
enabled: true
size: 1Gi
## If defined, volume.beta.kubernetes.io/storage-class: <storageClass>
## Default: volume.alpha.kubernetes.io/storage-class: default
##
# storageClass:
accessMode: ReadWriteOnce
# existingClaim: ""

service:
type: ClusterIP
Expand Down

0 comments on commit ea3beef

Please sign in to comment.