Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Use volumeclaim templates in Helm to provsion volumes #254

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions k8s/helm/PostDock/templates/barman/claim.yaml

This file was deleted.

13 changes: 12 additions & 1 deletion k8s/helm/PostDock/templates/barman/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,15 @@ spec:
volumeClaimTemplates:
- metadata:
name: barman-data
{{ end }}
spec:
accessModes: ["ReadWriteOnce"]
{{- if .Values.postgres.volume.storageclass }}
storageClassName: {{ .Values.postgres.volume.storageclass }}
{{ end }}
resources:
requests:
storage: {{ .Values.barman.volume.size }}
{{- if .Values.barman.volume.definition }}
{{- toYaml .Values.barman.volume.definition | indent 8 }}
{{ end }}
{{ end }}
17 changes: 0 additions & 17 deletions k8s/helm/PostDock/templates/barman/volume.yaml

This file was deleted.

17 changes: 0 additions & 17 deletions k8s/helm/PostDock/templates/postgres/claims.yaml

This file was deleted.

12 changes: 11 additions & 1 deletion k8s/helm/PostDock/templates/postgres/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,14 @@ spec:
volumeClaimTemplates:
- metadata:
name: db-data

spec:
accessModes: ["ReadWriteOnce"]
{{- if .Values.postgres.volume.storageclass }}
storageClassName: {{ .Values.postgres.volume.storageclass }}
{{ end }}
resources:
requests:
storage: {{ .Values.postgres.volume.size }}
{{- if .Values.postgres.volume.definition }}
{{- toYaml .Values.postgres.volume.definition | indent 8 }}
{{ end }}
19 changes: 0 additions & 19 deletions k8s/helm/PostDock/templates/postgres/volumes.yaml

This file was deleted.

32 changes: 6 additions & 26 deletions k8s/helm/PostDock/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,31 +32,12 @@ postgres:
# postgres.replicationDb.password - database user {postgres.replicationDb.user} password
password: replica_pass
# postgres.nodes - configurations per postgres node in PostDock release
nodes:
# postgres.nodes.[*].volume - define how the volume for your node will look like
volume:
# postgres.volume - define how the volume for your node will look like
# .size - size of the volume and claim
# .reclaimPolicy - k8s reclaim policy
# .definition - will be copied to volume object as is,
# if empty, volume will not be created for the node (assuming k8s will manage it by itself)
# Examples:
# ```
# hostPath:
# path: /tmp/db-data-mysystem-db-node-0
# ```
# ```
# awsElasticBlockStore:
# fsType: ext4
# volumeID: vol-xxxxxxx
# ```
- volume:
size: 100Gi
reclaimPolicy: Delete
- volume:
size: 100Gi
reclaimPolicy: Delete
- volume:
size: 100Gi
reclaimPolicy: Delete
# .storageclass - name of the storageclass to be used for the volume
size: 100Gi

# postgres.resources - define (in k8s style) resources for postgres pods of PostDock release
resources:
# postgres.env - environment variables for postgres nodes (@see https://github.com/paunin/PostDock#postgres)
Expand Down Expand Up @@ -101,7 +82,6 @@ barman:
resources:
# barman.env - environment variables for barman nodes (@see https://github.com/paunin/PostDock#barman)
env:
# barman.volume - same as {postgres.nodes.[*].volume}
# barman.volume - same as {postgres.volume}
volume:
size: 200Gi
reclaimPolicy: Delete