Backup job failing with No such file or directory @ rb_sysopen - /etc/gitlab/objectstorage/pages
Summary
Since !1677 (merged), backup job fails with error /usr/lib/ruby/2.7.0/psych.rb:577:in
initialize': No such file or directory @ rb_sysopen - /etc/gitlab/objectstorage/pages (Errno::ENOENT)`.
tl:dr : I think this issue is link to the discrepancy between https://gitlab.com/gitlab-org/charts/gitlab/-/blob/master/charts/gitlab/charts/task-runner/templates/backup-job.yaml and https://gitlab.com/gitlab-org/charts/gitlab/-/blob/master/charts/gitlab/charts/task-runner/templates/deployment.yaml :
`{{- include "gitlab.pages.mountSecrets" $ | nindent 10 }}`
and
`{{- include "gitlab.appConfig.objectStorage.mountSecrets" (dict "name" "pages" "config" $.Values.global.pages.objectStore) | nindent 10 }}`
are missing from the backup-job configuration.
Steps to reproduce
Install the gitlab chart at current (master) version (bug has been merged after 3.7.1 release) with a valid pages configuration and a valid backup cronjob configuration (e.g with mine) :
gitlab:
## doc/charts/gitlab/task-runner
task-runner:
enabled: true
replicas: 1
backups:
cron:
enabled: true
concurrencyPolicy: Replace
resources:
requests:
cpu: "50m"
memory: "350M"
schedule: "0 2 * * *"
objectStorage:
backend: "s3"
config:
secret: s3-minio
key: connection
resources:
requests:
cpu: "200m"
memory: "500M"
securityContext:
fsGroup: "1000"
runAsUser: "1000"
Current behavior
Cronjob pods fail at startup with error :
/usr/lib/ruby/2.7.0/psych.rb:577:in `initialize': No such file or directory @ rb_sysopen - /etc/gitlab/objectstorage/pages (Errno::ENOENT)
from /usr/lib/ruby/2.7.0/psych.rb:577:in `open'
from /usr/lib/ruby/2.7.0/psych.rb:577:in `load_file'
from (erb):108:in `<main>'
from /usr/lib/ruby/2.7.0/erb.rb:905:in `eval'
from /usr/lib/ruby/2.7.0/erb.rb:905:in `result'
from /scripts/set-config:22:in `block in <main>'
from /scripts/set-config:18:in `each'
from /scripts/set-config:18:in `<main>'
Begin parsing .erb files from /var/opt/gitlab/templates
Writing /srv/gitlab/config/database.yml
Writing /srv/gitlab/config/cable.yml
Writing /srv/gitlab/config/resque.yml
Writing /srv/gitlab/config/gitlab.yml
Manually running the backup from within the permanent task runner pod works fine.
Expected behavior
Cronjob should work the same way as the permanent task-runner pod. Pages configuration should be injected in both.
Versions
- Chart: 275234bc