Skip to content
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

[Kubernetes] Breaks on Kubernetes ReadOnlyFileSystem #39

Open
Moep90 opened this issue May 2, 2024 · 5 comments
Open

[Kubernetes] Breaks on Kubernetes ReadOnlyFileSystem #39

Moep90 opened this issue May 2, 2024 · 5 comments

Comments

@Moep90
Copy link

Moep90 commented May 2, 2024

On a ReadOnlyFileSystem Pod in Kubernetes, you got many Read-only file system errors

$ k logs -f supertokens-core-9fbc964db-t7vgj
Defaulted container "supertokens-core" out of: supertokens-core, create-db (init)
chown: changing ownership of '/usr/lib/supertokens/.started': Read-only file system
chown: changing ownership of '/usr/lib/supertokens/LICENSE.md': Read-only file system
chown: changing ownership of '/usr/lib/supertokens/cli/argon2-jvm-2.11.jar': Read-only file system
chown: changing ownership of '/usr/lib/supertokens/cli/argon2-jvm-nolibs-2.11.jar': Read-only file system
chown: changing ownership of '/usr/lib/supertokens/cli/cli.jar': Read-only file system
chown: changing ownership of '/usr/lib/supertokens/cli/gson-2.3.1.jar': Read-only file system
chown: changing ownership of '/usr/lib/supertokens/cli/jackson-annotations-2.16.1.jar': Read-only file system
chown: changing ownership of '/usr/lib/supertokens/cli/jackson-core-2.16.1.jar': Read-only file system
[....]
chown: changing ownership of '/usr/lib/supertokens/plugin-interface/plugin-interface-4.0.6.jar': Read-only file system
chown: changing ownership of '/usr/lib/supertokens/plugin-interface': Read-only file system
chown: changing ownership of '/usr/lib/supertokens/version.yaml': Read-only file system
chown: changing ownership of '/usr/lib/supertokens/webserver-temp': Read-only file system
chown: changing ownership of '/usr/lib/supertokens/': Read-only file system

There are many chown commands in the entry point; could they be make it optional?

For Instance as an ENV

env:
  READ_ONLY_FS: true
  # OR
  K8S: true
  # OR
  ON_KUBERNETES: true

chown -R supertokens:supertokens /usr/lib/supertokens/

@rishabhpoddar
Copy link
Member

Hi @Moep90

We will have to investigate this, but not quite sure when, since this issue hasn't been bought up by others that use SuperTokens on Kubernetes.

Maybe you could fork our repo and make your own docker image? We have instructions on how to do that here: https://github.com/supertokens/supertokens-core/wiki/Building-from-source#creating-a-docker-image

@rishabhpoddar
Copy link
Member

Not quite sure. The helm chart is community contributed.

@Moep90
Copy link
Author

Moep90 commented May 2, 2024

It is currently impossible to run the docker image in a Kubernetes cluster with specific security requirements, such as a ReadOnlyRootFilesystem and/or another UID.

@rishabhpoddar
Copy link
Member

Oh yea, I get that. Which is why i suggested to create your own docker image from the link above without the chown command in it.

We can further investigate if we can remove that from our repo, but, not quite sure about the timeline for that, unless there is a lot of interest in this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants