Mounting custom templates conflicts with init-directories sidecar #237

Closed
opened 2021-11-02 11:49:20 +00:00 by pat-s · 2 comments
Member

When using the following mount

extraVolumes:
- name: themes
  secret:
    secretName: gitea-themes

extraVolumeMounts:
- name: themes
  readOnly: false
  mountPath: "/data/gitea/public/css/"

the init-directories container errors during pod startup with the following message:

kubectl logs --tail 200 -n gitea gitea-0 -c init-directories                                                                                                                             4s 12:14:31
+ mkdir -p /data/git/.ssh
+ chmod -R 700 /data/git/.ssh
+ '[' '!' -d /data/gitea ']'
+ mkdir -p /tmp/gitea
+ chown 1000:1000 /tmp/gitea
+ chmod ug+rwx /tmp/gitea
+ cp /etc/gitea/conf/app.ini /data/gitea/conf/app.ini
cp: can't create '/data/gitea/conf/app.ini': No such file or directory

It looks like the mount conflicts with the creation/permissions of /data/gitea in the init-directories container.
I also tried to use readOnly: true without effect.

Maybe the helm chart needs to be adaptive here when creating the directory in case there is an extraVolumeMount which already created parts of the dir?

When using the following mount ```yml extraVolumes: - name: themes secret: secretName: gitea-themes extraVolumeMounts: - name: themes readOnly: false mountPath: "/data/gitea/public/css/" ``` the `init-directories` container errors during pod startup with the following message: ``` kubectl logs --tail 200 -n gitea gitea-0 -c init-directories  4s 12:14:31 + mkdir -p /data/git/.ssh + chmod -R 700 /data/git/.ssh + '[' '!' -d /data/gitea ']' + mkdir -p /tmp/gitea + chown 1000:1000 /tmp/gitea + chmod ug+rwx /tmp/gitea + cp /etc/gitea/conf/app.ini /data/gitea/conf/app.ini cp: can't create '/data/gitea/conf/app.ini': No such file or directory ``` It looks like the mount conflicts with the creation/permissions of `/data/gitea` in the `init-directories` container. I also tried to use `readOnly: true` without effect. Maybe the helm chart needs to be adaptive here when creating the directory in case there is an extraVolumeMount which already created parts of the dir?
Member

Maybe we would need to use projected volumes to map many sources into one /data directory.

Maybe we would need to use `projected` volumes to map many sources into one `/data` directory.
Member

Duplicate with #296. I'll close this one in favor of the newer which is already labelled and references in some other items.

Duplicate with #296. I'll close this one in favor of the newer which is already labelled and references in some other items.
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: gitea/helm-chart#237
No description provided.