Getting started with Kubernetes


Kubernetes is an open source orchestration tool for application containers developed by Google. It packages all of the necessary tools – orchestration, service discovery and load balancing in one place. Kubernetes is portable which means it can be deployed on public, private, hybrid along with multiple cloud platform providers. It is developed to manage Docker containers.

Image result for kubernetes

Kubernetes is a full-fledged container orchestration system that includes a scheduler, health checks, rolling upgrades, autoscaling, etc. whereas another popular orchestration tool Docker Swarm, is mainly about providing a cluster-wide view of a single Docker engine.

With Kubernetes:
a) Applications can be deployed quickly and with zero downtime
b) Applications can be scaled on the fly
c) Applications can be self-healed

Terms used in Kubernetes

Master is a node that manages the Kubernetes cluster, including assigning pods to minions, etc.
Minion is an agent node that runs the pods assigned by the master node.
Pod is a group of one or more containers for an application which runs on minion nodes.
Deployment is a controller which manages the pods. It ensures the desired number of pods are always running.
Replica set is the desired number of pods which needs to be running always.
Service is an endpoint that exposes the ports to the outside world and mapped the port to the container port (target port)
kubectl is an command line tool used for creating/deleting/retrieving  deployments, pods, services, hpa (horizontal pod autoscaling), etc., drain, . basically a utility to run commands on the kubernetes cluster:commands

Useful commands

kubectl describe nodes: This command provides the list of the minion nodes in the cluster, their status and the age (uptime):

kubectl describe nodes <node name> : This command provides some extra information about the node including Name, labels, resource limits. If the node runs out of capacity, disk space full, it will provide all those details:nodes1

kubectl get deployment <options>: This command provides the list of deployments, its age, desired and current capacity of the pods, number of available pods:deployment

kubectl get pods or kubectl get pods -o wide: This command provides the details about the pods including status of the pods, actual and desired capacity of the containers in the READY column, node on which the pod is running and the age of the pods, IP of the pods and how many times a pod has been restarted:pods

kubectl get svc or kubectl get svc -o wide: This command provides the name of the service, cluster IP of the service, external IP/endpoint, ports it has been mapped to (inbound port) and its age:svc

Hope this helps you in understanding the basics of Kubernetes.
In my upcoming blogs, I will be explaining how to deploy applications without downtime, rolling update strategy, assigning a pod to multiple nodes,  readiness probe, multiple containers in a pod etc.

Views: 1


What is the capital of Egypt? ( Cairo )