Skip to content

Commit

Permalink
Merge pull request #755 from rooftopcellist/mv-data-subPath
Browse files Browse the repository at this point in the history
Use an Init Container to move the pg data subPath in the pvc
  • Loading branch information
rooftopcellist authored Jan 28, 2022
2 parents 18d17f2 + 5b636bb commit d27ce3c
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions roles/installer/templates/deployment.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,22 @@ spec:
{% endif %}
{% if bundle_ca_crt or projects_persistence|bool or init_container_extra_commands %}
initContainers:
- name: database-check
image: '{{ _init_container_image }}'
imagePullPolicy: '{{ image_pull_policy }}'
command:
- /bin/sh
- -c
- |
[[ -d /check-db/pgsql/data ]] && rm -rf /check-db/data; mv /check-db/pgsql/data/ /check-db/data/ && rm -rf /check-db/pgsql
volumeMounts:
- name: check-db-pvc
mountPath: /check-db
subPath: ''
volumes:
- name: check-db-pvc
persistentVolumeClaim:
claimName: postgres-{{ ansible_operator_meta.name }}-postgres-0
- name: init
image: '{{ _init_container_image }}'
imagePullPolicy: '{{ image_pull_policy }}'
Expand Down

0 comments on commit d27ce3c

Please sign in to comment.