Docker: Deploying to production with Kubernetes
This is quickstart guide on how to deploy a docker application with kubernetes.
You will need the following
- Google cloud SDK installed
- A Google Cloud platform account
Your first step is to create your project here [https://cloud.google.com/resource-manager/docs/creating-managing-projects#creating_a_project]
You will need to authenticate yourself and also setup your project on the cli with the following:
Assuming you have your production Dockerfile(s) prepared we now need to build our image (After this you may wish to run it to test it locally via Docker run)
Next we will push our Docker image to google cloud.
We’ll now create our cluster ( We can either set the zone before or in the create with the –zone flag)
Once that is finished we can run the following to see if it created successfully
Now we need to create our deployment file. The purpose of the deployment file is to tell kubernetes how want the state of our application/resources to be. It is then it’s job to maintain that state.
Finally we will expose our cluster and also provision a load balancer
We can then run the following to see our exposed IP’s and ports
And with that you should now be able to go to the exposed IP/port and see your application running