How to build a sidecar container for passing files from a machine outside of the Kubernetes cluster?

I have a noob question. If I’m using a docker image that uses a folder located in the host to do something, Where should be located the folder in the kubernetes cluster? I’m ok doing this with docker since I know where is my host filesystem but I get lost when I’m on a kubernetes cluster.

Actually, I don’t know if this is the best approach. But what I’m trying to do is build a development environment for a php backbend. Since what I want is that every person can run a container environment with their own files (which are on their computers), I’m trying to build a sidecar container so when launching the container I can pass the files to the php container.

  • Kubernetes - how to send request to all the minions?
  • Docker container exiting when launched with Fleet
  • using gcloud docker client on coreos
  • Spawn multiple fleet-units of same app on same node (CoreOS + Fleet)
  • CoreOS Kubernetes how to monitor Node processes?
  • How to build stateful docker services architecture with CoreOS's fleet?
  • The problem is that I’m running kubernetes to build development environment for my company using a vagrant (coreos + kubernetes) solution since we don’t have a cloud service right now so I can’t use a persiten disk. I try NFS but it seems be too much for what I want (just pass some information to the pod regardless of the PC where I am). Also I try to use hostPAth in Kubernetes but the problem is that the machines where I want connect to the containers are located outside of the kubernetes cluster (Vagrant + CoreOS + Kubernetes so I-m trying to expose some container to public IPs but I can not figure out how to past the files (located in the machines outside of the cluster) to the containers.

    Thanks for your help, I appreciate your comments.

  • Docker compose variables
  • Cannot exit from Docker container
  • docker mongodb replication on same server
  • Confused about multiple different containers using a single data volume containers [closed]
  • fossology docker image fails to start
  • ARG value is not expanding in Dockerfile
  • One Solution collect form web for “How to build a sidecar container for passing files from a machine outside of the Kubernetes cluster?”

    Not so hard, actually. Check my gists may give you some tips:

    See, do not try to consume files from outside, just package them in a docker image, and consume them by sidecar mode.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.