Kubernetes
Nowadays, every application wants to have high availability, fast deployments and reduce environment-related issues,and which has led to an era of containerized applications. Docker is one of a very popular container used as a container. Managing multiple containers is also a challenge and can help in releasing applications with low downtime. Kubernetes, a Google product, is evolving as a leader in the container cluster orchestration system.
Kubernetes is an open-source platform and is production-ready. Container Applications planning to use this model needs to make sure they don’t have details of hosts or a decoupled code.
What are its main components?
A Kubernetes cluster consists of two elements:
– Master Node: It takes care of various activities including autoscaling, updating, etc.
– Node: A VM, also called as Kubelet, act as a worker. This is where the application lives.
How to deploy?
Before deploying the application, let’s make sure we have a working cluster. Then we need a Kubernetes Deployment configuration file,
and which actually have the instructions of creating instances. The master node will use this and will deploy the application on available nodes.
It acts as a template, and we can specify a minimum number of nodes required in any environment.
So, in this case, the master node will automatically create a new instance if any is terminated or removed.
In a pre-orchestration world, installation scripts would often be used to start applications, but they did not allow recovery from machine failure.
By both creating your application instances and keeping them running across Nodes, Kubernetes Deployments provide a fundamentally different approach to application management.
Let’s see definitions of various elements:
About Pod :
Many times, we have shared resources in a cluster environment and Kubernetes helps in making an abstraction for these elements.
It may include a single IP address, some information, shared storage, shared data.
About MiniKube:
This is a handy tool for developers. It is a lightweight Kubernetes implementation that can be installed on local machines.
Developers can play around on Kubernetes features using this and simulate cluster.
About GKE :
Google Container Engine (GKE) is an open source management platform for Docker containers and the clusters.
About Kube-proxy :
Kube-proxy can run on each and every node and can do simple TCP/UDP packet forwarding across backend network service.
About Heapster :
Heapster lets us do the container cluster monitoring. It lets us do cluster-wide monitoring and event data aggregation.
About Kubectl :
Kubectl is the platform using which you can pass commands to the cluster.
Sample Commands:
kubectl version : the version of client and server
kubectl cluster-info: Cluster information
kubectl get nodes: List of all nodes in a cluster
kubectl create deployment {appName} –image={docker image} : Create a deployment from a docker image and put it on available node
kubectl get deployments : List available application deployments
kubectl get pods : List all pods
kubectl describe pods :Detailed information of node, pods, deployments.
kubectl logs {pod name} : Logs of the given pod name
kubectl exec -ti {pod name} bash : Get into bash of the pod/vm
About Ingress network :
Ingress network has all the network rules and acts as an entry point to the cluster.
Difference between kubernetes and docker swarm?
Both are popular orchestration tools.
Kubernetes has a GUI dashboard which docker swarm don’t have.
Kubernetes has good support for autoscaling which docker swarm is missing right now.