Unable to install Jenkins on Minikube using Helm due to the permission

1/4/2021

I've been trying to install Jenkins by using Helm on Minikube according to the official article

https://www.jenkins.io/doc/book/installing/kubernetes/

It turns out that I can't bring up the Jenkins Pod, kubectl logs -f jenkins-0 -c init -n jenkins gives me this error

disable Setup Wizard
/var/jenkins_config/apply_config.sh: 4: /var/jenkins_config/apply_config.sh: cannot create /var/jenkins_home/jenkins.install.UpgradeWizard.state: Permission denied

From my assumption, this issue obviously relates with permission in Dockerfile or it might relates to the defined values in jenkins-values.yaml. I've changed some parameters as the recommended values.

storageClass: jenkins-pv

serviceAccount:
create: false
name: jenkins
annotations: {}

serviceType: NodePort

release detail

NAME    NAMESPACE       REVISION        UPDATED                                 STATUS          CHART           APP VERSION
jenkins jenkins         1               2021-01-04 15:58:00.022465588 +0700 +07 deployed        jenkins-3.0.14  2.263.1   

is there anyway to fix this?

Thanks

-- BTH.S3
jenkins
kubernetes
kubernetes-helm

1 Answer

1/5/2021

It seems that for some reason the volume is mounted with not-enough access rights. You can try running your container with the root user. It may solve the issue. Put these lines into your values.yaml.

runAsUser: 0
fsGroup: 0
-- RafaƂ Leszko
Source: StackOverflow