jjethwa / rundeck

GNU General Public License v3.0
123 stars 137 forks source link

kubernetes : can't read /etc/rundeck pv #153

Open cyrilbkr opened 5 years ago

cyrilbkr commented 5 years ago

Hi,

I use your docker-image in kubernetes with a persistent volume for the config dir (/etc/rundeck) but i got the following error in the pod log :

sed: can't read /etc/rundeck/rundeck-config.properties: No such file or directory
jjethwa commented 5 years ago

Hi @cyrilbkr

Sorry about the issue. The container will copy the default set of configurations from /opt/rundeck-defaults if /etc/rundeck is completely empty. Is that directory empty? If not, try manually copying over the files from this repo to your /etc/rundeck volume or try a fresh start with the volume directory empty before starting your customisation. Let me know how that works for you :smiley:

cyrilbkr commented 5 years ago

Thank you for your fast reply 👍

When using a fresh and empty persistent volume, i still have the issue. I can't run a shell in the container to check the etc dir because it crash too early in kubernetes.

I tried your fix, i mounted the persistent volume in an tmp directory and i manually copy the generated etc files, then i restarted the pod and mounted the persistent volume in /etc/rundeck and it worked.

Anyway, I see the owner of the etc files is rundeck, maybe kubernetes failed to writes this files as a non root user when starting the pod. I'll look, keep you update.

Thanks

jjethwa commented 5 years ago

No problem! Yes, the container initialisation script chowns the files under /etc/rundeck and other directories as needed due to the original docker implementation not handling ownership nicely. I don't have a lot of kubernetes experience, but I'm betting it has a way to map the user id or file permissions back to the host VM for easier management. That might do the trick for you. I'm currently on vacation, but can look at it a bit more when I get back next week :smiley: