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

Support read-only mode in pod security context #97

Open
jesper7 opened this issue May 18, 2023 · 1 comment
Open

Support read-only mode in pod security context #97

jesper7 opened this issue May 18, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@jesper7
Copy link
Contributor

jesper7 commented May 18, 2023

Currently, enabling read-only mode in the security context for the UI pod causes it to crash.
This is because the UI uses server-side rendering and must write compiled files to the local filesystem. We should mount the directory for the compiled files as a volume to fix this.

@jesper7 jesper7 added the bug Something isn't working label May 18, 2023
@rishabhdas
Copy link
Contributor

Additional Context:

Pod Security Context:

securityContext:
    readOnlyRootFilesystem: true
    allowPrivilegeEscalation: false
    privileged: false

Pod Logs

$ kubectl logs studio-ui-7689b48fb9-k4m29 -n iterative-studio  
No certificates to update
yarn run v1.22.19
warning Skipping preferred cache folder "/home/node/.cache/yarn" because it is not writable.
warning Selected the next writable cache folder in the list, will be "/tmp/.yarn-cache-1000".
$ node scripts/prepare-build.js && next start
warning Cannot find a suitable global folder. Tried these: "/usr/local, /home/node/.yarn"
node:internal/fs/utils:347
    throw err;
    ^

Error: EROFS: read-only file system, open '/app/.next/server/pages/404.html'
    at Object.openSync (node:fs:590:3)
    at Object.writeFileSync (node:fs:2202:35)
    at walk (/app/scripts/prepare-build.js:66:10)
    at Object.<anonymous> (/app/scripts/prepare-build.js:71:1)
    at Module._compile (node:internal/modules/cjs/loader:1191:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1245:10)
    at Module.load (node:internal/modules/cjs/loader:1069:32)
    at Function.Module._load (node:internal/modules/cjs/loader:904:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:22:47 {
  errno: -30,
  syscall: 'open',
  code: 'EROFS',
  path: '/app/.next/server/pages/404.html'
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

@jesper7 jesper7 self-assigned this Jun 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants