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.

  • Accessing host different ports in production
  • Kubernetes minion not completely connecting
  • Enable etcd service auto start in CoreOS via systemd
  • Zero Downtime app deployment with CoreOS
  • CoreOS + docker issues with losetup
  • Fleet can't launch Docker registry container
  • 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: using multiple Dockerfiles for multiple services
  • Unable to create docker machine with Digital Ocean
  • Launching run docker from cloud-init incorrectly prefixes “” to image name
  • How do you deploy a docker image into Cloud Foundry? [Bluemix]
  • I want to get the artifact version deployed by Jenkins
  • Why do I receive a bin/bash error when running this simple ansible playbook?
  • 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.