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: Configmap is mounted to home as directory #31

Closed
Shegox opened this Issue Dec 18, 2018 · 3 comments

Comments

Projects
None yet
3 participants
@Shegox
Copy link

Shegox commented Dec 18, 2018

When executing a step, the kubernetes runtime mounts f.e. the .netrc file to the /root/ directory. This causes the whole /root/* to be read-only.

This can be resolved with using a subpath to mount only the specific file from the configmap.

This can result in errors like these when using node:

+ + npm i
npm ERR! path /root/.npm
npm ERR! code EROFS npm ERR! errno -30 npm ERR! syscall mkdir npm ERR! rofs EROFS: read-only file system, mkdir '/root/.npm' npm ERR! rofs Often virtualized file systems, or other file systems npm ERR! rofs that don't support symlinks, give this error.
@paulreimer

This comment has been minimized.

Copy link

paulreimer commented Jan 15, 2019

I can confirm this issue -- I'm unable to use the drone-serverless plugin, as the sls executable attempts to create a dotfile in /root upon first run.

@Shegox

This comment has been minimized.

Copy link
Author

Shegox commented Jan 15, 2019

hey @paulreimer,
a quick fix you try is overriding the $HOME env variable. Some tools (gcloud, npm, docker) use them to determine where to create a dotfile. Something like the below solved the problem temporarily for me.

- name: container-build-push
  image: plugins/docker
  privileged: true
  settings:
    repo: eu.gcr.io/test
    registry: eu.gcr.io
    tag: ${DRONE_BUILD_NUMBER}   
    password:
      from_secret: google_credentials
    username: _json_key
    debug: true
  environment:
    HOME: "/tmp"

@bradrydzewski bradrydzewski changed the title [Kubernetes] Configmap is mounted to home as directory kubernetes: Configmap is mounted to home as directory Jan 22, 2019

@bradrydzewski

This comment has been minimized.

Copy link
Member

bradrydzewski commented Jan 22, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment