An introduction to orchestration
When someone uses the word “orchestration,” what inevitably comes to mind is an old man conducting an orchestra with a little stick in his hand. This may not be very far from the truth, as the reason you always see an old man doing this job is that it requires years of experience. Orchestras normally have a wide range of instruments from wind instruments to string instruments to percussionists and vocalists, and it’s the job of one man (and, in some still rare cases, one woman) to make sure they all complement each other and stay in harmony. Similarly, Docker orchestration is the practice of successfully managing your containers all the way from conception to testing to production.
How containers work, and why we love them
The entire concept of containerization isn’t very hard to grasp. As applications and software have moved forward over the years, one thing that has remained standard is the need to constantly upgrade and innovate. It is quite common that applications gain popularity overnight and the rising demand often causes system crashes and sleepless nights. The whole point behind containerization is to build a system where all the parts are interchangeable and can grow or be cut down without disturbing the rest of the system.
Think of it like a bunch of civil engineers planning a city for about 5,000 people. One group would build it exactly for 5,000 people. When the people outgrow this infrastructure it will require redevelopment, which involves tearing down the old buildings to make space for the new. With container orchestration, it’s like the engineers had foresight and built water, electricity, and drainage supplies that could be upgraded without tearing down current buildings and still have enough room for the city to grow and build on itself. Being able to upgrade resources without having to tear anything down or be counterproductive is vital to applications that require frequent version updates, and it is this ability to grow or downsize without disturbing the system that has made containers so popular.
In the illustration above, the left is an example of well-planned and organized city, and on the right is what can happen when you don’t plan or manage growth properly.
Clustering and cluster management
Clustering is a very important part of orchestration as it allows a group of containers to be addressed as a single unit. A good example would be a mailroom where you have letters, cards, postcards, and packages. Instead of sending them out one at a time you allot them to letter carriers based on geographic locations — maybe one letter carrier for north, one for south, east and west respectively. Now, think of these letter carriers as your clusters and the mail as your containers. Instead of individually addressing each container, all you need to do is address the respective letter carrier.
Interchangeability of containers
Applications normally consist of hundreds of processes running together at the same time, and in harmony, like an orchestra. The added benefits of having containers is that the containers can be swapped in and out as needed without stalling the entire process they support. Imagine riding a motorcycle long distance. To prepare for any eventuality, you would have to carry a variety of spare parts. Now imagine this motorcycle was made of just one kind of part, a single building block like a Lego, and each Lego could be programmed independently. In this situation you would have one block programmed to be the carburetor, one to be the engine block, one to be the motorcycle chain, and so on. Now barring any major mishaps, all you would have to do is carry a few of these magic Lego blocks and you would be prepared for any eventuality. This example might be a stretch of the imagination, but the isolation of processes using containers means you can swap containers with updated ones on the fly. This makes releasing updates and fixing bugs a quick and painless process.
Docker Orchestration, and the problems addressed by it
The issue that arises while using containers is that they are quite hard to keep track of in large volumes. Not only do conventional monitoring tools fail to properly monitor containers, but without proper planning and architecture it is quite easy to make a mess of things. That doesn’t mean that companies are not using Docker in production, but what it means is that things are still in development and that this is a phase of growth and change. There are now a number of tools that aid in the successful orchestration of container systems like Docker. Let’s look at three of the most popular ones.
Meet the Tools
As we mentioned earlier, imagine an orchestra made of identical blocks and each block could be programmed to be a different instrument. We can’t exactly tell them what to do by waving a stick around, but what we can do is get the right tools to program them so they all work together in harmony.
As of today, Kubernetes is by far the most popular option for Docker orchestration. Kubernetes is Google’s own venture in the world of containers and cluster management, and since its release in June 2014, it has quickly acquired a large community of partners and developers. Being open source software, the value added by people contributing to the project from all over the world is something that you cannot put a price on. Kubernetes is used with Docker to manage and keep track of containers. With Google promoting its own cloud-based platform, they are developing Kubernetes as a great way for their clients to scale up applications without increasing overhead.
Yes, Docker has its own clustering tool called Swarm. But for really large-scale containerization, many organizations use Apache Mesos. Apache Mesos is another open source cluster management software that has been adopted by a number of technology giants, Twitter and Apple included. This is ideal for really large-scale operations where you are dealing with hundreds of thousands of clusters.
Although Kubernetes is the most popular orchestration tool to use with Docker, Docker has recently added built-in orchestration to Docker Swarm. Both these tools were made to manage clusters, but the similarities end there. Kubernetes is like an extension of Google’s own clustering software that has been adapted to work with Docker and requires a certain level of expertise to successfully install and run. Kubernetes installation differs from OS to OS, while Docker swarm is packaged as a container itself, and installs and runs the same way irrespective of the OS. Docker swarm also has the added advantage of communicating well with all tools that work with Docker. Clearly, Docker sees the need for a robust orchestration solution for its containers and wants to build the right tool themselves.
Why containers are the way of the future
Docker isn’t the only containerization software out there, but it is fast becoming the global standard. But because of a lack of security, and, more important, lack of Docker orchestration tools, companies still prefer to use virtual machines in production. When compared with virtual machines, containers just don’t have enough management and orchestration tools to make them safe enough to use in production. Good orchestration is the missing link. Once this is solved, Docker will outperform and outshine conventional virtual machines any day of the week.
Photo credit: NetDNA-CDN.com