Add support to run gitea with an optional securityContext #115
Reference in New Issue
Block a user
No description provided.
Delete Branch "set_securitycontext"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Add the option to initialize and run gitea with a securityContext.
Yes, but I find that when running with the following context:
The init container fails with the following error:
init su: must be suid to work properly
What I found when trying this PR, is that Gitea required to run root (#120) on only from 1.14 rootless will be available, and only then this will work, as the current image requires root access
Thanks for your PR i will check on this once 1.14 is the default image :)
We would like to run gitea as a specific uid in order to access NFS data via kerberos. I don't know if setting the uid is possible in the rootless work that is coming up.
https://github.com/go-gitea/gitea/issues/14780
Did not have a closer look into this issue yesterday sorry.
Of course we can merge this PR prior to 1.14 since it only adds the possibility to set a security context.
I was hoping to improve the security for my Gitea installation with this. Unfortunately when setting the example as @Dunky13 posted I get the following error from the gitea container iteself (init is fine):
https://gitea.com/gitea/helm-chart/pulls/115#issuecomment-313716
The security context doesn't work (yet), since it will be released in Gitea 1.14 - we are currently in 1.13. So waiting for the "rootless" release. The security context can only work when gitea doesn't require root access, as it does now
Yeah, realised it after I posted. A few things have changed with 1.14 so this might be a challenge for those who are using the Helm Chart I guess. Seams to have
latest
mostly working now on my setup.@Dunky13 just tested with
latest-rootless
which is v1.14-dev, it failed with the error you posted. Wondering ifsecurityContext
should also be applied to the init container as well?@Starefossen I am not sure, haven't tested with rootless, as in the context I'm working in, I need a steady version number. Could possibly be the case. But would require some testing on a cluster either you, or if @luhahn has time & energy to put in that effort?
Ok, so the problem is init.yaml#L25: