This is a creation in Article, where the information may have evolved or changed.
Guide:
Kubernetes today rage, all major cloud service providers use it as a solution for deploying cloud-native applications. What are the salient features and tools that the kubernetes has to start accepting? The author of this paper gives a systematic carding.
"Action without orchestration is burn out; Orchestration w/o action is management. "
The action without orchestration is finished, the choreography without action is management, action plus orchestration is the leader.
―orrin Woodward "
Kubernetes is an abstraction that optimizes resource utilization, which allows for efficient application distribution across node clusters.
Kubernetes, Helmsman!
Kubernetes is a Greek word that means "helmsman".
It's an open-source project started by Google, derived from Borg and used within Google for several years and is now used for container management. Currently hosted by CNCF.
Kubernetes (abbreviated as K8S) is an abstraction that optimizes the utilization of resources such as CPUs and memory through containers, enabling efficient application distribution across multiple nodes. K8s can run anywhere in bare metal or any cloud infrastructure provider. This new tool is cloud-agnostic and focuses on deploying and dispatching containers within the infrastructure, rather than using nodes/hosts directly.
Some of the platform features provided by K8S are:
Container grouping using PODS self-healing auto-scaling DNS Management load balancing rolling updates or rolling back resource monitoring and logging
Kubernetes Architecture
The Kubernetes cluster consists of a master node and a set of worker/subordinate nodes.
The main node components of the kubernetes are:
API Server (API Server) : the user interacts with Manifestyaml through the rest operation or the Kubectl CLI. It is used for all operations related to API objects, such as pod creation, which is the only component that stores the desired state in ETCD.
Controller Manager: the controller manager operates on a resource based on cluster state and changes according to the manifest Yaml to bring the current state application to the desired state. In other words, the Controller manager can reconcile the actual state with the desired state. There are several dedicated controllers in the Controller manager to simplify cluster management. For example, the node controller checks to see if there are currently running node outages and takes corrective action, while the replication controller ensures that the number of pods required to actually run in the node.
Plugins (Addons): in order to add server DNS records to kubernetes, we need a clustered DNS plug-in. This plug-in helps extend the functionality associated with kubernetes clusters or nodes. There are many other plugins, such as fluntd for logging, RBAC based on role access, and so on.
The components installed in the Kubernetes node are:
For high-availability and fault-tolerant kubernetes production and deployment, multiple master nodes and a separate ETCD cluster are required. If you run three API servers, you need a network load balancer to properly distribute the load to the server. The only remaining problem is that you need three roles to manage the Controller manager and scheduler to maintain cluster status and assign nodes. To perform it more efficiently and reliably, only one participant should perform the actual change, but other instances are still required in case of machine downtime. To solve this problem, we can use Lease-lock in the API to perform the main selection, and the flag to use it is leader-elect.
The Kubernetes implements the networking from pod to pod in one of the following ways:
1) 2nd Layer (switching Solution) 2) 3rd layer (bridging Solution) 3) Overlay solution (Weave andflannel)
They allow communication between pods and pods in the cluster and provide a unique IP address for each pod.
Kubernetes Key Features
Pod:collection of containers Container set
Pod is a deployment unit in k8s, which has a separate IP address. Inside it, the pause container handles the network by holding a network's namespace, port, and IP address, which are used by all containers in the pod.
Replicationcontroller
Replicationcontroller ensures the number of containers required to start and run within a given time. Pod templates are used to define container mirroring identifiers, ports, and labels. With liveness probes, it automatically heals pods and maintains pods in the desired state. You can also manually control the replica count by using Kubectl.
Storage Management
The essence of pods is short--any information stored in pods or containers will be lost. In order to store data, a persistent system is required, even after a pod is killed or re-dispatched, such as Amazon Elastic Block Storage (EBS), Google GCE PD, or a distributed file system such as a network file system (NFS) or Gluster file System (GFS).
Resource monitoring
Monitoring is one of the keys to a successful infrastructure, and it is the basis for reliability levels. Heapster is a plug-in that collects metrics from Kubelet and integrates with Cadvisor. The cadvisor is used to collect metrics related to the CPU, memory, I/O, and network statistics that run the container. The data collected by Heapster is stored in influx DB and is displayed in the UI using Grafana. There are other receivers that can be used, such as Kafka or elastic Search, which can be used to store data and display it in the user interface.
Health Check
Kubernetes's health check is done by the Kubelet agent. It is divided into two kinds of liveness and readiness probes.
There are three main types of handlers:
Execaction: Executes the shell command, if the generated exit code is 0, it means that the instance is healthy. In any other case, the instance is unhealthy. Tcpaction:kubelet will attempt to connect to the specified port if it establishes a connection to the given socket and the diagnostic succeeds. Httpgetaction: Based on the HTTP endpoint exposed by the application, Kubelet performs an HTTP GET request on the container IP address on the specified path, and if 200 to 300 response codes are returned, the diagnostics succeed.
Each probe usually has three results:
Success: the container passes diagnostics. Failed: The container did not pass diagnostics. Unknown: Diagnostics fail, do not take any action.
Horizontal Auto-scaling function
Auto scaling uses load-based computing resources. The k8s scale pod automatically uses the horizontal Pod Autoscaler object to get metric data from heapster and to reduce or increase the number of pods accordingly. For example, if auto scaling is based on memory utilization, the controller begins to observe memory usage in the pod and scales the copy count based on capacity.
Service discovery
Kubernetes pods are ephemeral, replicationcontroller create them dynamically on any node, so discovering services in a cluster is a challenge. The service needs to discover an IP address and a dynamic port for communication in the cluster.
There are two main ways to find it-environment variables (environment variables) and DNS.
More preferable is DNS-based service discovery, which can be used as a cluster add-on. Track new services in the cluster and create a set of DNS records for each service.
Internet
To fully manage a cluster, you must set up the network correctly and resolve three network problems:
1. Container-to-container communication: Pods communicates with the local host and uses the Pause container network name space to solve this problem. 2. Pod-to-pod communication: Resolved by a software-defined network, as shown in the architecture diagram above. 3. External to pod communication: overwritten by the service.
Kubernetes offers a wide range of network options. Container network Interface (MLM) plug-ins are now supported, which is the generic plug-in architecture for containers. Several orchestration tools are currently supported, such as Kubernetes, Mesos, and Cloudfoundry.
There are various overlay plugins:
1.Flannel from CoreOS, is a very simple ETCD backend overlay network. It creates another virtual, routable ip/pod network that runs on top of the underlying network, and ergo, known as an overlay network. In this overlay network, each pod will be assigned an IP address and will be used to communicate directly with their IP. 2.Weave provides kubernetes-compatible overlay network via the MLM plugin.
Service
The Kubernetes service is an abstraction that routes traffic to a set of pods to provide a microservices service. Kube-proxy runs on each node and manages the service by setting up a set of iptable rules.
There are three modes of service creation:
1. Clusterip (internal access only) 2. Nodeport (requires a firewall on the port; public access is not recommended) 3. Load balancer (owned by public cloud vendors such as AWS or Gke)
Configmap and Secret
Configmap makes it possible to inject an environment-based configuration, while keeping the container image consistent across multiple environments. These can be injected by installing a volume or environment variable (environment variables) and storing the values in key/value format.
Secrets is used to store sensitive data such as passwords, OAuth tokens, and so on.
Rolling deployment and rollback
The deployment object holds one or more replica sets to support the rollback mechanism. In other words, each time a deployment configuration is changed, a new replica set is created and the previous version is retained for rollback options. Only one replica set will be active at a specific time.
For rolling deployments, the required policy types are rollingupdate and minreadysecs, which specify the amount of time the application spends on service traffic. If the application pod is not ready, it will be unavailable if it is kept in its default state. This action can be done with the following command:
Or
Replace the content in the deployment Yaml file and run the following command:
If the new version is not as expected, you can roll back to a previous release by running the following command:
If the desired version is a version other than the previous version, run:
Logging Records
To monitor the behavior of your application, you must check the log--each pod generates multiple logs. To begin searching for logs in the dashboard UI, there must be mechanisms to collect and aggregate them into a log viewer. To illustrate this, FLUENTD is an open source tool and a part of CNCF, a perfect combination of Elastic Search and Kibana.
Original link:
Kubernetes:twelve Key Features
Https://dzone.com/articles/kubernetes-twelve-key-features