Describe Kubernetes and what it is used for
Kubernetes, is an open-source orchestration tool designed to automate: deploying, scaling and operating containerized applications.
It is designed to grow from tens, thousands, or even millions of containers. Organizations adopting Kubernetes increase their velocity by releasing faster and recovering faster with Kubernetes self-healing mechanisms, thus increasing productivity and decreasing cost.
Kubernetes is a distributed system. Multiple machines are configured to form a cluster. Machines may be a mix of physical and virtual and may exist on-prem, and in cloud infrastructure, each with their own unique hardware configurations.
Kubernetes places containers on machines using scheduling algorithms that consider:
- available compute resources,
- requested resources,
- and a variety of customizable constraints
Kubernetes is also smart enough to move containers to different machines as machines are added and removed.
Kubernetes is also container runtime agnostic, which means you can actually use Kubernetes with different container run-times: like Docker and others.
Ease of use: Kubernetes also provides excellent end-user abstractions, such as:
- Kubernetes uses declarative configuration for everything.
- Engineers can quickly deploy containers.
- Wire-up networking
- scale and expose applications to the world.
Operations made easy too: Operation staff are not left in the cold either.
- Kubernetes can automatically move containers from failed machines to running machines.
- There are also built-in features for doing maintenance on a particular machine.
- Multiple clusters may join up to form a federation. This feature is primarily for redundancy. If one cluster dies, containers will automatically move to another cluster.
The following Kubernetes’ features also contribute to making Kubernetes a top choice for orchestrating containerized applications.
Alternatives to Kubernetes
With the popularity of containers there has been a surge in tools to support enterprises adopting containers in production. Kubernetes is just one example. Let’s compare Kubernetes with other tools now that we know what Kubernetes can do. Sometimes comparing one technology to another is the best way to understand it and also learn about others in the process. We’ll compare DC/OS, Amazon ECS and Docker swarm mode. Each has its own niche and unique strength. This section should help you understand Kubernetes approach and decide if it fits your particular use case.
DC/OS or Distributed Cloud Operating System is similar to Kubernetes in many ways. DC/OS pools compute resources into a uniform task pool. The big difference here is that DC/OS targets many different types of workloads, including, but not limited to containerized applications. This makes DC/OS attractive to organizations which are not using containers for all of their applications. DC/OS also includes a package manager to easily deploy systems like like Kafka and Spark. You can even run Kubernetes on DC/OS given its flexibility for different types of workloads.
Amazon ECS, or Elastic Container Service is AWS’s first entry into the container orchestration space. ECS allows you to create pools of compute resources and uses API calls to orchestrate containers across them. Compute resources are EC2 instances that you can manage yourself or let AWS manage them for you using AWS Fargate. It’s only available inside AWS. It may be useful for those of you who are deep into the AWS ecosystem.
Docker swarm mode is the official Docker solution for orchestrating containers across a cluster of machines. Docker swarm mode builds a cluster from multiple docker hosts and distributes containers across them. It shares a similar feature set with Kubernetes. Docker swarm mode works natively with the Docker command. This means associated tools like Docker Compose can target swarm mode clusters without any changes. Docker’s enterprise edition leverages swarm mode to manage an enterprise-grade cluster. Docker also provides full support of Kubernetes if you start with swarm mode and decide later to use Kubernetes.
If you aren’t already fixed on using Kubernetes I would recommend you conduct your own research and understand each tool, its trade-offs and appropriate fitness for your use case.
So far we got a quick overview of what Kubernetes is and some of its key features. The following topics are discussed in subsequent posts:
- Describe Kubernetes and what it is used for (this post)
- Deploy single and multi-container applications on Kubernetes
- Use Kubernetes services to structure N-tier applications
- Manage application deployments with rollouts in Kubernetes
- Ensure container pre-conditions are met and keep containers healthy.
- Learn how to manage configuration, sensitive data and persistent data in Kubernetes.
- Discuss popular tools and topics surrounding Kubernetes in the ecosystem.
- Course GitHub repository
- Introduction to Kubernetes Playground Lab
- Docker Desktop for Mac or Windows
- Kubernetes in Docker
The Introduction to Kubernetes Playground lab is what I am using for running the kubernetes commands. However, you can use any Kubernetes cluster you have access to including clusters you can run locally, for example using
Docker Desktop for Mac or Windows,
Kubernetes in Docker or K in D.