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.