Pattern for Bridging Containers -> Kubernetes deployments

10/5/2015

I have a Kubernetes deployment and a local developer environment running in a container. The app requires memcached, which I'd like to run in its own container and run linked. I do not want to change my application at all between development and production, I'd like the environment to do that for me. So, my problem is how do I configure my application to work properly in both environments? My thoughts:

  1. Inject the variable into the app using something like Figaro. This feels heavy weight for just a few different items I'd like to configure.
  2. Run a script at startup of the Docker container to rewrite the /etc/hosts, just when running on my local machine. Super hacky but easy.
  3. Run using hyperkube or some other local version of Kubernetes.

Something else?

-- aronchick
docker
kubernetes

1 Answer

10/5/2015

Running Kubernetes locally is your best bet, to ensure you have the same environment in development as what you're deploying to.

We recommend running Kubernetes locally via Docker as the best starting point for local testing.

If for some reason that doesn't work for you, let us know, but you could also try running Kubernetes locally on Vagrant.

-- Alex Robinson
Source: StackOverflow