-
-
Notifications
You must be signed in to change notification settings - Fork 318
Unable to set readOnlyRootFilesystem
in Kubernetes deployment
#1967
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hmmm. Looks like some proxies are written to I'll check if this can be configured. |
If they could stay in /tmp that would be great since I can mount an emptyDir to that location. |
I'm afraid that's not possible (at least without an unreasonable amount of changes). Shlink needs to write a number of temporary/static files at runtime (GeoLite db file, entity proxies, service proxies, filesystem locks, configuration cache files, etc). However, all files are (or should) be written inside Of course, that leaves the fact that there seems to be something writing in |
Good idea, so I created a emptyDir mount to
It looks like there are more directories in play here, maybe you just need a single place for all these temp file operations to use? |
The only directory you need to mount is I'm not sure if that's possible though. In retrospect, I think it probably would have made sense that migrations were located somewhere else, but I think the migrations tool tracks their path, so I'm not sure if that can be changed now. I'll check. |
Writing to Looking at the error, it seems writing to |
I have already verified it is possible to move migrations somewhere else, so that everything inside the data dir is stuff generated at runtime. I also need to check if it can be shipped as an empty dir, ensuring subdirs are created as required. At the moment, a few of those subdirs need to exist for everything to work, so mounting an empty dir would still fail even without taking migrations into consideration. |
I'm pretty confident that, as a workaround, you should be good to go by mounting empty dirs to If it still fails, you may need to mount In the meantime I'll continue investigating if it's possible to ship Shlink with an empty |
Nah, scratch that. The GeoLite db downloading needs to write directly in |
Looks like there is also a problem here... |
This is not needed when running Shlink with RoadRunner or openswoole. I'll change it as part of the other modifications. |
This is what I have finally decided to do.
With this, the only consideration is the fact that one of the deps needs to write in Worst case scenario, you will have to mount |
I have just released v3.7.3-beta.1, which includes the changes explained above. The |
Confirmed working with setting an emptyDir to |
Uh oh!
There was an error while loading. Please reload this page.
Shlink version
3.7.2-non-root
PHP version
3.7.2-non-root
How do you serve Shlink
RoadRunner Docker image
Database engine
PostgreSQL
Database version
16.1
Current behavior
I am trying to set a Kubernetes security context on shlink however it doesn't work and falis with the following error.
Expected behavior
The application should not need r/w access to the root filesystem
How to reproduce
Deploy shlink in Kubernetes and set the security context as I mentioned above.
The text was updated successfully, but these errors were encountered: