Before we continue I would recommend reading the Container Engine documentation since this will give you a better understand of the commands we are going to use.
For the impatient ones, you can simply type in the commands and return to the documentation later on.
For our live setup we are going to use Google Cloud Platform (GCP), specifically the Container Engine product within this ecosystem.
To get started create an account with GCP - there is a 0 credit which will be more than enough to complete this exercise together.
If you use a custom container, you will find the file in the deploy directory of your container.
For example, would be the location for a default JBoss installation.
At Supr Nation we have been using Docker for quite a while now.
Docker has been an amazing tool in our arsenal - it has enabled us to package and deploy microservices without having to worry about inconsistencies (library, servers, OS) between live, staging and dev environments.
We will start our adventure into the Docker/Kubernetes world by creating a simple FROM jeanblanchard/busybox-java MAINTAINER [email protected] mkdir -p /opt/hello-world ADD target/helloworld-0.0.1/opt/hello-world ENTRYPOINT java -jar /opt/hello-world/helloworld-0.0.1EXPOSE 8080 FROM jeanblanchard/busybox-tomcat MAINTAINER [email protected] rm -rf /opt/apache-tomcat-8.0.23/webapps/* ADD target/helloworld-0.0.1/opt/apache-tomcat-8.0.23/webapps/EXPOSE 8080 Having Docker-ised our application and tested that it works in a dev environment (our local machines) let us now deploy on our live environment.
To retrieve the IP that the service is running on run the following command: In this case we got assigned the ephemeral IP 104.1. Let us now update our application to display “Hello Universe! ” by updating the file Before concluding it is important to stress out that Kubernetes is but one way how we can orchestrate Docker containers. The take-home message from this post should be the concept of containerising your deployment - we create an application, containerise it to isolate the inconsistencies and deploy it on a cluster / machine which understands the container specification.
If you haven’t started using this workflow I urge you to invest some time and give it a spin; I’m pretty sure you will not regret it.
First thing we need to do is to download and set up the Google Cloud SDK.
On OSX we can use the following commands: Visually you can view all your docker images by navigating to the Container Registry as follows: So far we have created a Kubernetes cluster and pushed our application to the private Container Registry present on this cluster.