Wondering about container orchestration? When your organization manages too many containers, you start to need container orchestration. We'll explain.
What is container orchestration?
Container orchestration is the automation of many operational tasks in your container-based applications. This includes processes such as:
Containers are a bundle of a piece of code and everything needed for the code to run. Once your code is in a container, you can deploy it to any environment and be sure it will run.
Containers often contain microservices, which are small parts of your application or product that have a standalone function. For example, you might have a microservice that handles users viewing their shopping cart. The container for this service would bundle together:
However, the container would likely not contain:
More and more, organizations are building their applications based on microservices rather than a monolithic service that handles everything. Containers are a popular way to organize services using this type of architecture.
Essentially, using containers allows you to build your system step-by-step like Lego building blocks that can be added, removed or modified. This is rather different compared to carving it out of one very large piece of marble which would be a monolithic approach.
Containers are an investment; they require you to establish standards for each container and build infrastructure for them to integrate with each other at runtime. You’ll also need to invest in tools to manage your containers, such as Docker or Kubernetes.
Even with these tools to help, managing containers becomes very time consuming as your application and environment scales. Complex applications can use hundreds of containers at a time. If you needed to make a change across all of your containers, the time sink could be massive. This is why you need container orchestration.
Container orchestration is the process of automating the management of your containers. Rather than manually make choices and changes for each container, the container orchestration platform automatically performs these tasks for every relevant container.
Container orchestration can handle:
There are two major things you need to do to use container orchestration:
1. Add metadata and hooks into your containers.
i. Your containers should contain metadata to categorize them and classify them.
ii. They should also contain consistent hooks in the code that changes their settings and can be accessed externally.
iii. This allows the orchestration program to issue commands to the correct subset of containers.
2. Build an orchestration program to control the containers.
i. It needs to be able to issue custom commands to any given subset of containers, such as changing their settings, deploying new instances, or taking them down.
ii. It needs to monitor the health of containers and collect the data in a centralized location
iii. It also needs to be set up to automatically react to changes in the health of containers by changing settings or reallocating resources.
This is not an easy system to build, let alone maintain over time. Most organizations use a container orchestration platform or tool to help them.
There are two major container orchestration platforms, Kubernetes and Docker Swarm. Both allow you to build, manage, and orchestrate containers.
Kubernetes emphasizes adaptability, allowing you to containerize a wide variety of microservices and functions.
Docker Swarm, on the other hand, emphasizes ease of use by using more templated Docker nodes, allowing easy setup and deployment of simpler services.
Other popular container orchestration platforms include:
Some of these are tools that manage your instances of Kubernetes or Docker. Choose the right tools depending on the complexity and size of your service. Look for tools that support all the container functions that you’ll need while still simplifying the process of creating and orchestrating containers.
Container orchestration can be performed in any type of environment - local servers, private clouds, 3rd party clouds, or any combination. No matter where they are, containers are containers. However, there are some considerations you should have when choosing a tool:
Like containerizing your system, setting up container orchestration is an investment. You need to establish what the orchestration will be able to do in order to set up each container correctly. If you need more functionality later, it will be difficult to retroactively add that.
You also need to make sure that all development teams are on the same page about developing within containers. If your containers are inconsistent, orchestration will be especially difficult. Make sure that the standards are clearly understood by every developer.
Deciding who has ownership of container orchestration can be tricky. Development creates the code that goes into containers, but operations manages the deployed containers. DevOps setups can help connect these two sides. The DevOps team can make sure the orchestration setup works for both development and operations’ needs.
Container orchestration also fits into the SRE development process at several stages:
Blameless SLIs and SLOs can make the most of your container-based system. Weave the collection of metrics generated by your microservices into fewer metrics that reflect user requirements and happiness. To see how, check out a demo!