Skip to content

Commit

Permalink
Merge pull request #13 from Signalen/ci/datawarehouse-pvc
Browse files Browse the repository at this point in the history
Ability to configure persistent volume for datawarehouse
  • Loading branch information
CBuiVNG authored Dec 4, 2020
2 parents cb5ec39 + 13e3c2e commit 0ab75b0
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 9 deletions.
6 changes: 6 additions & 0 deletions backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ The backend Helm chart installs the Signalen API and the by default the followin
| `image.tag` | The tag of the Docker image | `latest` |
| `replicaCount` | The number of API replicas | `1` |
| `workerReplicaCount` | The number of background worker replicas | `1` |
| `persistence.media.enabled` | Enable persistence of media | `true` |
| `persistence.media.size` | Specify the size of the media PVC | `1Gi` |
| `persistence.media.existingClaim` | Name of an existing PVC to use | `null` |
| `persistence.datawarehouse.enabled` | Enable persistence of datawarehouse | `false` |
| `persistence.datawarehouse.size` | Specify the size of the datawarehouse PVC | `1Gi` |
| `persistence.datawarehouse.existingClaim` | Name of an existing PVC to use for datawarehouse | `null` |
| `settings.allowedHosts` | Restrict the allowed hosts of the API | `*` |
| `settings.defaultPdokMunicipalities` | A (comma-seperated) list of [PDOK municipalities](https://www.pdok.nl/introductie/-/article/cbs-wijken-en-buurten) the API allows complaints for (e.g. `"Amsterdam,'s-Hertogenbosch"`) | `""` |
| `settings.organizationName` | The name of the organization | `"Signalen"` |
Expand Down
8 changes: 4 additions & 4 deletions backend/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -128,16 +128,16 @@ spec:
containerPort: 8000
volumes:
- name: media
{{- if .Values.persistence.enabled }}
{{- if .Values.persistence.media.enabled }}
persistentVolumeClaim:
claimName: {{ if .Values.persistence.existingClaim }}{{ .Values.persistence.existingClaim }}{{- else }}{{ template "signals-backend.fullname" . }}{{- end }}
claimName: {{ if .Values.persistence.media.existingClaim }}{{ .Values.persistence.media.existingClaim }}{{- else }}{{ template "signals-backend.fullname" . }}{{- end }}
{{- else }}
emptyDir: {}
{{- end }}
- name: dwh-media
{{- if .Values.persistence.enabled }}
{{- if .Values.persistence.datawarehouse.enabled }}
persistentVolumeClaim:
claimName: {{ if .Values.persistence.existingClaim }}{{ .Values.persistence.existingClaim }}{{- else }}{{ template "signals-backend.fullname" . }}{{- end }}
claimName: {{ if .Values.persistence.datawarehouse.existingClaim }}{{ .Values.persistence.datawarehouse.existingClaim }}{{- else }}{{ template "signals-backend.fullname" . }}-datawarehouse{{- end }}
{{- else }}
emptyDir: {}
{{- end }}
20 changes: 18 additions & 2 deletions backend/templates/persistent-volume-claim.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }}
{{- if and .Values.persistence.media.enabled (not .Values.persistence.media.existingClaim) }}
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
Expand All @@ -10,5 +11,20 @@ spec:
- ReadWriteOnce
resources:
requests:
storage: {{ .Values.persistence.size }}
storage: {{ .Values.persistence.media.size }}
{{- end }}
{{- if and .Values.persistence.datawarehouse.enabled (not .Values.persistence.datawarehouse.existingClaim) }}
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ template "signals-backend.fullname" . }}-datawarehouse
labels:
{{- include "signals-backend.labels" . | nindent 4 }}
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: {{ .Values.persistence.datawarehouse.size }}
{{- end }}
11 changes: 8 additions & 3 deletions backend/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,14 @@ ingress:
- api.signals.local

persistence:
enabled: true
size: 1Gi
existingClaim: null
media:
enabled: true
size: 1Gi
existingClaim: null
datawarehouse:
enabled: false
size: 1Gi
existingClaim: null

settings:
allowedHosts: "*"
Expand Down

0 comments on commit 0ab75b0

Please sign in to comment.