Skip to content

Commit

Permalink
pvc: add web app shared volume
Browse files Browse the repository at this point in the history
  • Loading branch information
Pablo Panero committed Dec 14, 2021
1 parent f1439de commit c62efbc
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ If for some reason you need to update parameters you can simply edit them in
the `values-overrides.yaml` file and use the `upgrade` command:

```bash
$ helm upgrade -f values-overrides.yaml invenio ./invenio
$ helm upgrade --atomic -f values-overrides.yaml invenio ./invenio
# Release "invenio" has been upgraded. Happy Helming!
# NAME: invenio
# LAST DEPLOYED: Tue Dec 7 15:29:08 2021
Expand Down
10 changes: 10 additions & 0 deletions invenio/templates/deployments/web.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ spec:
mountPath: '/opt/invenio/src/uwsgi'
- name: nginx-invenio-assets
mountPath: /opt/nginx-invenio-assets
{{- if .Values.persistence.enabled }}
- mountPath: /opt/invenio/var/instance/data
name: shared-volume
{{- end }}
resources:
requests:
cpu: 500m
Expand Down Expand Up @@ -185,6 +189,7 @@ spec:
{{- end }}
- name: nginx-config
configMap:
defaultMode: 420
name: nginx-config
- name: var-run
emptyDir: {}
Expand All @@ -198,3 +203,8 @@ spec:
name: uwsgi-config
- name: nginx-invenio-assets
emptyDir: {}
{{- if .Values.persistence.enabled }}
- name: shared-volume
persistentVolumeClaim:
claimName: {{ .Values.persistence.name }}
{{- end }}
11 changes: 11 additions & 0 deletions invenio/templates/deployments/worker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,24 @@ spec:
- "celery -A {{ .Values.worker.app }} inspect ping -d celery@$(hostname)"
initialDelaySeconds: 20
timeoutSeconds: 30
{{- if .Values.persistence.enabled }}
volumeMounts:
- mountPath: /opt/invenio/var/instance/data
name: shared-volume
{{- end }}
resources:
requests:
cpu: 500m
memory: 500Mi
limits:
cpu: '1'
memory: 1Gi
{{- if .Values.persistence.enabled }}
volumes:
- name: shared-volume
persistentVolumeClaim:
claimName: {{ .Values.persistence.name }}
{{- end }}
{{- if .Values.worker.imagePullSecret }}
imagePullSecrets:
- name: {{ .Values.worker.imagePullSecret }}
Expand Down
15 changes: 15 additions & 0 deletions invenio/templates/pvc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{{- if .Values.persistence.enabled }}
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: {{ .Values.persistence.name }}
labels:
app: web
spec:
storageClassName: {{ .Values.persistence.storage_class }}
accessModes:
- {{ .Values.persistence.access_mode }}
resources:
requests:
storage: {{ .Values.persistence.size | quote }}
{{- end }}
7 changes: 7 additions & 0 deletions invenio/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,13 @@ worker:
log_level: INFO
replicas: 2

persistence:
enabled: true
name: "shared-volume"
access_mode: ReadWriteMany
size: 10G
storage_class: ""

redis:
enabled: true
host: ""
Expand Down

0 comments on commit c62efbc

Please sign in to comment.