Source code changes in kubernetes, SaltStack & Docker in production and locally

This is an abstract question and I hope that I am able to describe this clear.

Basically; What is the workflow in distributing of source code to Kubernetes that is running in production. As you don’t run Docker with -v in production, how do you update running pods.

  • What's benefit of docker's image layer?
  • windows docker on vmwarevsphere
  • Using Docker to create “restorable” MySQL database for UI testing
  • Multicast not being sent to all Docker containers
  • How to set docker-machine env for fabric local() commands
  • Cannot upload play application to dokku, gzip: stdin: unexpected end of file
  • In production:
    Do you use SaltStack to update each container in each pod?

    Or

    Do you rebuild Docker images and restart every pod?

    Locally:
    With Vagrant you can share a local folder for source code. With Docker you can use -v, but if you have Kubernetes running locally how would you mirror production as close as possible?

    If you use Vagrant with boot2docker, how can you combine this with Docker -v?

  • Docker Compose Up gives “The system cannot find the file specified.” error
  • Sharing a configuration file to multiple docker containers
  • Can Docker be deployed on version 2.6.x of the Linux kernel?
  • How can I mount a file in a container, that isn't available before first run?
  • Can one use python 3.5 in a docker container based out of the TensorFlow docker image?
  • Unable to install Npsql via nuget
  • One Solution collect form web for “Source code changes in kubernetes, SaltStack & Docker in production and locally”

    Short answer is that you shouldn’t “distribute source code”, you should rather “build and deploy”. In terms of Docker and Kubernetes, you would build by means of building and uploading the container image to the registry and then perform a rolling update with Kubernetes.

    It would probably help to take a look at the specific example script, but the gist is in the usage summary in current Kubernetes CLI:

    kubecfg [OPTIONS] [-u <time>] [-image <image>] rollingupdate <controller>
    

    If you intend to try things out in development, and are looking for instant code update, I’m not sure Kubernetes helps much there. It’s been designed for production systems and shadow deploys are not a kind of things one does sanely.

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