Skip to content
This repository has been archived by the owner on Jun 23, 2020. It is now read-only.

kubernetes: Configmap is mounted to home as directory #31

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

kubernetes: Configmap is mounted to home as directory #31

Shegox opened this issue Dec 18, 2018 · 3 comments
Labels
kubernetes Issues related to the Kubernetes Engine

Comments

@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
Copy link

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
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 added the kubernetes Issues related to the Kubernetes Engine label Jan 22, 2019
@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
Copy link
Member

fixed by drone/drone-yaml@1e125e1

stevecrozz pushed a commit to stevecrozz/drone-runtime that referenced this issue Jun 14, 2019
Initial matrix conversion support
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kubernetes Issues related to the Kubernetes Engine
Projects
None yet
Development

No branches or pull requests

3 participants