What is Kubernetes?
Open-source platform Kubernetes allows declarative configuration and automation of containerized workloads and services. An ecosystem of great size and rapid growth resides there. Several Kubernetes tools, services, and support options are available.Kubernetes derives its name from Greek, meaning pilot or helmsman. As an abbreviation, K8S is derived from the eight letters that lie between the “K” and the “s”. Google’s Kubernetes project was open sourced in 2014. Kubernetes brings together over 15 years of Google’s production workload management experience with community-derived best-of-breed best practices.
What is Kubernetes used for?
I think it’s more important that we understand what containers are and why people use them,
A container is a mini-virtual machine, It is small, because it does not require device drivers and other components, as a traditional virtual machine would. A container written in Linux, Docker is by far the most popular one. Windows also includes containers that Microsoft added as a result of the popularity of containers. An example will best illustrate why this is useful and important, Container creators realized that nginx and any other application that runs from a container only needs some bare minimum operating system to function. Therefore, they decided to create a stripped-down version of an OS for nginx to run within. Therefore, you can install a self-contained system anywhere that is machine-independent. Presently containers are so well known than they undermine to form VMs out of date.
Kubernetes Provides you with :
- Service discovery and load balancing : Kubernetes can expose using the DNS name or using their own IP address. If there is a high volume of traffic to a container, Kubernetes can load balance and distribute the traffic so that the deployment remains stable.
- Storage orchestration : The Kubernetes scheduler auto-mounts a storage system of your choice, such as local storage, public cloud providers, etc.
- Automated rollouts and rollbacks : Kubernetes allows you to describe what state your deployed containers should be in, and it can change its actual state to the desired state over time. By automating Kubernetes, you can create new containers for your deployment, remove existing containers and adopt their resources to the new containers.
- Automatic bin packing : Containerized tasks can be run on Kubernetes by giving it a cluster of nodes. Using Kubernetes, you can tell Kubernetes how much memory (RAM) each container needs. Containers can be attached to nodes in Kubernetes to maximize resource utilization.
- Self-healing : A user-defined health check triggers Kubernetes to re-start containers that fail, to replace containers, and to kill containers that do not respond. Kubernetes advertises containers only when they are ready to serve their users.
- Secret and configuration management : Kubernetes lets you store and manage sensitive information, such as passwords, OAuth tokens, and SSH keys. You can deploy and update secrets and application configuration without rebuilding your container images, and without exposing secrets in your stack configuration.
Kubernetes provides you with a cluster.
A Kubernetes cluster is a set of nodes that run containerized applications. A containerized application packages the app with its dependencies and some necessary services. They are lighter and more flexible than virtual machines. As a result, Kubernetes clusters make it easier to develop, move, and manage applications. Kubernetes clusters enable containers to run on multiple machines and environments, including virtual, physical, cloud-based, and on-premises. Here’s the diagram of a Kubernetes cluster,
Kubernetes terms explained
1. Kubernetes Master :
As in Kubernetes, the master node is responsible for managing and controlling a set of workers (workloads runtime).
A master node has the following components to help manage worker nodes:
- Kube-APIServer : which acts as the frontend to the cluster. All external communication to the cluster is via the API-Server.
- Kube-Controller-Manager : which runs a set of controllers for the running cluster. The controller-manager implements governance across the cluster.
- Etcd : the cluster state database.
- Kube Scheduler : which schedules activities to the worker nodes based on events occurring on the etcd. It also holds the nodes resources plan to determine the proper action for the triggered event. For example the scheduler would figure out which worker node will host a newly scheduled POD.
A highly available cluster is composed of at least 3 master nodes, each running a member of the etcd distributed database and all the Kubernetes master components (API, controller manager and scheduler).
2. Kubernetes Node :
Kubernetes Nodes are logical collections of IT resources that support a container or several containers. The nodes are responsible for running Pods (Kubernetes’ units of containers), communicating with master components, configuring networking, and running assigned workloads. It is possible for a Node to host multiple Pods.
Node components are worker machines in Kubernetes and are managed by the Master. A node may be a virtual machine (VM) or physical machine, and Kubernetes runs equally well on both types of systems. kubelet – watches the API server for pods on that node and makes sure they are running.
Kubernetes claims to support clusters with up to 5000 nodes. However, in practice, 500 nodes may already pose non-trivial challenges. The effects of large numbers of worker nodes can be alleviated by using more performant master nodes.A pod is the smallest execution unit in Kubernetes.
3. Kubernetes Pod :
The smallest Kubernetes execution unit is called a pod. A pod encapsulates one or more applications. Kubernetes automatically creates a new replica of a pod if it fails (or if the server it runs on fails). By nature, pods are ephemeral.
Each pod consists of multiple cooperating processes (as containers) that make up a cohesive unit of service. Each container in a Pod is automatically co-located and co-scheduled on a physical or virtual machine in the cluster.
4. Kubernetes Kubectl :
Kubernetes command line interface (CLI), kubectl , Runs commands against any Kubernetes cluster. Because OpenShift Container Platform runs on top of a Kubernetes cluster, a copy of kubectl is also included with oc , OpenShift Container Platform’s command line interface (CLI).
5. Kubernetes Minikube :
Minikube is a lightweight Kubernetes implementation that creates a VM on your local machine and deploys a simple cluster containing only one node. Minikube is available for Linux, macOS, and Windows systems.
6. Kubernetes Service :
A Kubernetes service is a logical abstraction for a deployed group of pods in a cluster (which all perform the same function). Since pods are ephemeral, a service enables a group of pods, which provide specific functions (web services, image processing, etc.) to be assigned a name and unique IP address (clusterIP).
7. Kubernetes Secrets :
Secrets are a Kubernetes object intended for storing a small amount of sensitive data. It is worth noting that Secrets are stored base64-encoded within Kubernetes, so they are not wildly secure. Ensure that you have role-based access controls (RBAC) in place to protect Secrets.
Like ConfigMaps, Secrets are used for storing confidential or proprietary information.
There is a caveat here: Kubernetes Secrets are stored unencrypted in the API servers’ underlying data store (etcd).
Get the most out of learning with VPSie.com