What is container Orchestration?
Container Orchestration is managing the lifecycle of containers in a dynamic environment. The life cycle of containers includes provisioning, deployment, redundancy, and availability of containers.
The major operations like scale up or down, resource allocation, health monitoring of containers and hosts. The popular tools for automating container orchestration are Kubernetes, Docker swarm
What is Kubernetes?
Kubernetes is an open-source platform for automating provisioning, deployment, scaling, and operations of application containers across clusters of hosts in a container-centric infrastructure.
It was organized by CNCF – Cloud native computing foundation. Kubernetes project was started by Google and released it to open source in 2015. The major contributors are google, CodeOS, Redhat, Mesosphere, Microsoft, HP, IBM, VMWare.
It is also called as K8S, K+8 letters (Kubernetes) + s
- Main features of Kubernetes
- Load balancing
- Grouping of containers
- Monitoring containers
- The declarative definition for containers using YAML files
- Run containers anywhere
- Rolling updates is possible
- Storage mounting
- Service discovery and exposure
- Labeling and selection of objects is possible
Where Kubernetes can run :
– Kubernetes cluster can contain images from various clouds like public, private, virtual or physical hardware and single server developer laptops. Kubernetes clusters can run a mix of the above including OS like Windows and Linux.
Kubernetes major components:
Kubernetes, the cluster refers to the group of machines running Kubernetes and the containers managed by it.
Master – A Kubernetes cluster must have a master, the system that commands and controls all the other Kubernetes machines in the cluster. Kubernetes master node can run from the multiple machines and only one master at a time runs the job scheduler and controller-manager.
Node – Node might be a physical machine or VM. Kubernetes cluster contains nodes.
Pod – Nodes run pods, the most basic and atomic unit of the Kubernetes object that can be created or managed. Each pod refers to a single instance of an application or running process in Kubernetes and consists of one or more containers. Kubernetes starts, stops, and replicates all containers in a pod as a group. Pods are created or destroyed on nodes as needed to meet the desired state specified by the user in the pod definition.
Controller – Kubernetes controller deals with the pod’s life cycle like how pod spun up, rolled out and spun down. A controller will take care of bring up the pods or application to the desired state.
Service – these define the given group of pods can be accessed via a network even though one of the services is busy with some update but the other services will work without any impact.
Scheduler – Scheduler will take care of the workload across the nodes so that the resources are balanced and deployments meet the application requirement.
Controller manager – As per the desired state defined in the etcd configurations, it maintains the application’s workload and state.
Benefits using Kubernetes:
- It manages application health, replication, load balancing, and hardware resource application automatically. Applications that are unhealthy are automatically healed by Kubernetes inbuilt features.
- Kubernetes provides maximizing the use of hardware resources including memory, storage, and network bandwidth. Apps that need minimal resources can be grouped together on the same hardware; apps that need to stretch out can be placed on systems where they have room to grow.
What is the difference between Kubernetes and Docker?
Kubernetes and Docker are not competitors at all. Containerization is more popular nowadays because it has more advantage than the VM virtualization. Containers provide isolation from the kernel so that the same application image can run in Linux and windows without any major modifications.
Docker is the popular open source container platform. Docker contains docker engine which allows building and running containers. Container images created on Docker platform can be shared in Docker hub for all the users.
Enterprise application contains a lot of container images which runs independently. Some software component should streamline or orchestrate the images to work together for the common objective.
There are container orchestration tools available in the market like Kubernetes, Mesos, Docker Swarm. So Kubernetes vs Docker means ” Kubernetes vs docker swarm”. Docker swarm is the Docker’s own native cluster solution for Docker containers.
To build, distribute and run the Docker containers we use Docker platform. It has its own clustering tool that can orchestrate and schedule the containers.
Kubernetes is a container orchestration tool for Docker containers and more extensive than Docker swarm.
Technology perspective Kubernetes and Docker are both different tools but they work together for facilitating the deployment of containers in the clustered setup.