DevOps Basics : Running Docker in production


Docker is a containerization technology very "trendy", which means a lots people are interested about it, using it or trying it.

Very often, when I engage the conversation about containerization I asked this two questions, in this order:

  1. How many of you are using containers (Docker or others technology)?
  2. How many of you are using this containerization technology in production?...

When I talk about production, it means for me: High Availability, SLA, Disaster recovery, and more... It cannot be a simple virtual machine running your containers.

It's funny to see the big drop in the room when I asked the second question.

In my previous articles, I showed you how it's very simple to deploy a Docker environment, but what about to run your containers in a real production environment?

In few words, if you want to run your Docker containers in a real production environment you need multiple tools and complex architectures are possible.

That's why we just created: Azure Container Service (ACS).

I will show you in this article, how you can easily deploy this service and use it to deploy you containers.

Deploying ACS

From the Azure gallery, search for Azure Container Service:

Deploy Azure Container Service portal

In the first panel you have to specify some basics options:

Deploy Azure Container Service Basics

In this example I created a new ssh keys pair thanks to ssh-keygen.exe and paste the .pub file on the SSH public key field

For the next, step you have to specify the H.A framework that you want to use, in my case I prefer to use DC/OS :

Deploy Azure Container Service framework

Next, you have to specify the numbers of Agent and Master that you want, depends on the size of the environment that you want. In my demo I want a small environment to test it :

Deploy Azure Container Service settings

The DNS prefix is the endpoint accessible from the outside for your environment.

Finally, validate your template and click on create.

You should see on your dashboard the deployment like this :

Deploy Azure Container Service deploying

Connecting to your environment

When your environment is ready, you have to initiate a SSH tunnel to use it.

Like me, if you are using Windows, you can do that simply with putty.exe.

You have all the information here : https://azure.microsoft.com/en-us/documentation/articles/container-service-connect/

If you want to know your endpoints, you can check through the portal, you should have two public IP address resources, one master and one agent. To initiate the connection, you need the master DNS name, in my case it’s: acscanitpromgmt.eastus.cloudapp.azure.com, so if I want to initiate the SSH connection I will enter the username + the endpoint, your username will be you DNS prefix: acscanitpro@acscanitpromgmt.eastus.cloudapp.azure.com

Deploy Azure Container Service endpoint

 

 

When the connection is initiated in Putty.exe you have:

Deploy Azure Container Service putty

If everything works well, you should be able to browse the two main tools:

  • http://localhost (DC/OS)

Deploy Azure Container Service OCCS

  • http://localhost/marathon (Marathon)

Deploy Azure Container Service Marathon

In one word, DC/OS is where you will manage your clusters and Marathon where you will orchestrate your containers (Start, Stop, Scale, etc...)

Deploying your application

Finally, let's try to deploy one application in our cluster.

To do that, go on the Marathon portal and click on Create Application:

Deploy Azure Container Service Create App

Enter the following information:

  • ID : canitpro
  • CPU : 0.1
  • Memory : 16Mb
  • Image : julienstroheker/helloworldguys
  • Network : Bridged
  • Container Port : 80
  • Protocol : tcp

Deploy Azure Container Service Create App GeneralDeploy Azure Container Service Create App DockerDeploy Azure Container Service Create App Ports

Next, you can click on "Create Application", you should see your application on the portal:

Deploy Azure Container Service Create App Deploying

When it's running, you can go back on the DC/OS portal to see the result and you have more resources available in your cluster:

Deploy Azure Container Service OCCS

 

Finnaly, you can see the result on your agent endpoint : http://acscanitproagents.eastus.cloudapp.azure.com/ in my case:

Deploy Azure Container Service Create App Result

 

Conclusion

With ACS, you can deploy in few clicks a full production wise cluster Docker in 10 minutes ! Azure will deploy for you, a bunch of VMs with all the tools installed and configured in best practices on it.

Resources and more info:

Thanks for reading.

Julien Stroheker @ju_stroh

 

Comments (2)

  1. Frank says:

    I’ve been browsing on-line greater than 3 hours
    nowadays, yet I by no means discovered any attention-grabbing article like yours.

    It is beautiful price sufficient for me. In my view, if all site owners
    and bloggers made excellent content material as you did, the web can be much more helpful than ever before.

    1. Hey Frank,

      Thanks a lot !!!!!

      @Ju_stroh

Skip to main content