简体   繁体   中英

Jenkins Deployment on Kubernetes has a problem with logs

I made a Jenkins Deployment on Kubernetes. It works fine but when I try to show container logs an error occurs.

$ kubectl logs jenkins-5b587f57b8-tfz2f
Can not write to /var/jenkins_home/copy_reference_file.log. Wrong volume permissions?
touch: cannot touch '/var/jenkins_home/copy_reference_file.log': Permission denied

Good working solution i found is adding a Security Context :

securityContext:
 fsGroup: 1000 
 runAsUser: 0

to Jenkins Deployment spec.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM