<p>I am hoping to find a good way to automate the process of going from code to a deployed application on my kubernetes cluster.</p>

<p>In order to build and deploy my app I need to first build the docker image, tag it, and then push it to ECR. I then need to update my deployment.yaml with the new tag for the docker image and run the deployment with kubectl apply -f deployment.yaml.</p>

<p>This will go and perform a rolling deployment on the kubernetes cluster updating the pods to the new version of the container image, once this deployment has completed I may need to do other application specific things such as running database migrations, or cache clear/warming which may or may not need to run for a given deployment.</p>

<p>I suppose I could just write a shell script that runs all of these commands, and run it whenever I want to start up a new deployment, but I am hoping there is a better/industry standard way to solve these problems that I have missed.</p>

<p>As I was writing this question I noticed stackoverflow recommend this question: <a href="https://stackoverflow.com/questions/34773609/kubernetes-deployments">Kubernetes Deployments</a>. One of the answers to it seems to imply at least some of what I am looking for is coming soon to kubernetes, but I want to make sure that if there is a better solution I could be using now that I at least know about it.</p>

<p>My colleague has a good blog post about this topic:</p>

<p><a href="http://blog.jonparrott.com/building-a-paas-on-kubernetes/">http://blog.jonparrott.com/building-a-paas-on-kubernetes/</a></p>

<p>Basically, Kubernetes is not a Platform-as-a-Service, it's a toolkit on which you can build your own Platform-a-as-Service. It's not very opinionated by design, instead it focuses on solving some tricky problems with scheduling, networking, and coordinating containers, and lets you layer in your opinions on top of it. </p>

<p>One of the simplest ways to automate the workflows you're describing is using a Makefile. </p>

<p>A step up from that, you can design your own miniature PaaS, which the author of the first blog post did here:</p>

<p><a href="https://github.com/jonparrott/noel">https://github.com/jonparrott/noel</a></p>

<p>Or, you could get involved in more sophisticated efforts to build an open source PaaS on Kubernetes, like OpenShift:</p>

<p><a href="https://www.openshift.com/">https://www.openshift.com/</a></p>

<p>or Deis, which is building a Heroku-like platform on Kubernetes:</p>

<p><a href="https://deis.com/">https://deis.com/</a></p>

<p>or Redspread, which is building "Git for Kubernetes cluster":</p>

<p><a href="https://redspread.com/">https://redspread.com/</a></p>

<p>and there are many other examples of people building PaaS on top of Kubernetes. But I think it will be a long time, if ever, that there is an "industry standard" way to deploy to Kubernetes, since half the purpose is to enable multiple deployment workflows for different use cases. </p>

<p>I do want to note that as far as building container images, <a href="https://cloud.google.com/container-builder/docs/">Google Cloud Container Builder</a> can be a useful tool, since you can do things like use it to automatically build an image any time you push to a repository which could then get deployed. Alternatively, Jenkins is a popular way to <a href="https://cloud.google.com/solutions/automated-build-images-with-jenkins-kubernetes">automate CI/CD flows with Kubernetes</a>.</p>
