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

PHRAS-4055 Add conditional volume mount in cronjobs #29

Open
wants to merge 3 commits into
base: main
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
2 changes: 1 addition & 1 deletion charts/phraseanet/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
version: 0.34.0
version: 0.35.0


# This is the version number of the application being deployed. This version number should be
Expand Down
44 changes: 8 additions & 36 deletions charts/phraseanet/templates/cronjob_phraseanet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,11 @@ spec:
template:
spec:
volumes:
- name: phraseanet-config
{{- range $volume := $cronjob.volumes }}
- name: phraseanet-{{ $volume.name }}
persistentVolumeClaim:
claimName: {{ $.Values.app.pvc_name.config }}
- name: phraseanet-datas
persistentVolumeClaim:
claimName: {{ $.Values.app.pvc_name.data }}
- name: phraseanet-thumbnails
persistentVolumeClaim:
claimName: {{ $.Values.app.pvc_name.thumbnails }}
- name: phraseanet-custom
persistentVolumeClaim:
claimName: {{ $.Values.app.pvc_name.custom }}
- name: phraseanet-ftp
persistentVolumeClaim:
claimName: {{ $.Values.app.pvc_name.ftp }}
- name: phraseanet-backup
persistentVolumeClaim:
claimName: {{ $.Values.app.pvc_name.backup }}
claimName: phraseanet-{{ $volume.name }}
{{- end }}
- name: phraseanet-tmp
emptyDir:
- name: phraseanet-logs
Expand All @@ -56,25 +43,10 @@ spec:
- -c
- docker/phraseanet/worker/entrypoint.sh; export TERM=xterm; su app -c "{{ $cronjob.command }}"
volumeMounts:
- name: phraseanet-config
mountPath: "/var/alchemy/Phraseanet/config"
- name: phraseanet-datas
mountPath: "/var/alchemy/Phraseanet/datas"
- name: phraseanet-tmp
mountPath: "/var/alchemy/Phraseanet/tmp"
- name: phraseanet-logs
mountPath: "/var/alchemy/Phraseanet/logs"
- name: phraseanet-thumbnails
mountPath: "/var/alchemy/Phraseanet/www/thumbnails"
- name: phraseanet-custom
mountPath: "/var/alchemy/Phraseanet/www/custom"
- name: phraseanet-cache
mountPath: "/var/alchemy/Phraseanet/cache"
- name: phraseanet-ftp
mountPath: "/var/alchemy/Phraseanet/ftp"
- name: phraseanet-backup
mountPath: "/var/alchemy/Phraseanet/backup"

{{- range $volume := $cronjob.volumes }}
- name: phraseanet-{{ $volume.name }}
mountPath: "/var/alchemy/Phraseanet/{{ $volume.name }}"
{{- end }}
env:
- name: STACK_NAME
value: {{ $.Values.app.stack_name | quote }}
Expand Down
23 changes: 23 additions & 0 deletions charts/phraseanet/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -295,36 +295,59 @@ app:
cpu: "2000m"
memory: "4096Mi"
cronjobs:
- id: job-0
installed: false
name: templatejob
suspend: false
schedule: "0 0-23/2 * * *"
command: "bin/console"
volumes:
- name: config
- name: datas
- name: thumbnails
- name: custom
- name: ftp
- name: backup
- id: job-1
installed: true
name: validationreminder
suspend: false
schedule: "0 0-23/2 * * *"
command: "bin/console validation:remind"
volumes:
- name: config
- id: job-2
installed: false
name: cleanusers
suspend: true
schedule: "30 3 * * 2"
command: "bin/maintenance clean:user --inactivity_period 365 --grace_duration 7 --max_relances 2 --remove_basket --dry-run"
volumes:
- name: config
- id: job-3
installed: false
name: apilogclean
suspend: false
schedule: "* 5 * * 5"
command: "bin/maintenance clean:ApiLogs --help"
volumes:
- name: config
- id: job-4
installed: false
name: workerjobclean
suspend: false
schedule: "* 4 * * 3"
command: "bin/maintenance clean:WorkerRunningJob --help"
volumes:
- name: config
- id: job-5
installed: false
name: dbbackup
suspend: false
schedule: "* 5 * * 0-6"
command: "bin/console system:backup-db -g backup/"
volumes:
- name: config
replicas:
fpm:
scale: 1
Expand Down