In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly explains the working mechanism of Kubernetes. The content of the explanation is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn the working mechanism of Kubernetes.
Kubernetes is an open source general multi-container management software, which provides basic deployment, elastic expansion, self-healing, load balancing and traffic routing, and is a powerful tool for coordinated management of micro-service applications. Kubernetes treats the entire data center as a supercomputer that can manage any type of container that complies with the OCI standard. (for example, Docker, Core OS's rkt container, and so on). The main functions of Kubernetes include automatic scheduling, self-healing, automatic deployment, rollback, horizontal scaling, and load balancing.
The Kubernetes architecture consists of two key components: the master node and the worker node (Minions).
Master node-the control node of the Kubernetes cluster
The Master node works like a team manager, responsible for the management and control of the entire cluster, distributing workloads, similar to football coaches who have absolute control over the team. The Master node is responsible for and makes global decisions, arranging a node to handle user requests. Kubernetes can also use multiple Master node settings to avoid a single point of failure (Multi-Master HA). The Master node runs only on Linux systems, but is not limited to any specific platform. It can be a bare metal server, an instance of VM, OpenStack, or any other cloud instance, but do not run the user container (user container) on the Master node.
Components of the Master node
The Master section has the following components.
Kube-apiserver Kube-apiserver, which follows the scale-out architecture, is the front end of the Master control node, provides an external interface and communicates with the outside world through REST API. It is the only operator of the resource object, and all other components must manipulate the resource data through the API provided by it.
Etcd-clustered storage etcd, the distributed key-value repository used by kubernetes by default, provides a reliable way to store data in a kubernetes cluster, mainly for shared configuration and service discovery. All the states of the cluster are stored in the etcd instance, which has the ability to monitor itself, so when the information in the etcd changes, it can quickly notify the relevant components in the cluster. The role played by etcd is so important that you must have a reliable backup plan.
Kube-controller-manager
Kube-Controller Manager is the management and control center of the cluster, maintaining all the controllers (controller) in the cluster, and plays a key role in maintaining the stability and self-repair of the cluster, achieving high availability, replica control and so on. It is an embedded controller and daemon responsible for namespace creation and garbage collection, mainly managing the following controllers:
Node Controller-manage nodes (create, update, and delete).
Replication controller-maintains the number of pod according to the list.
Service Account & Token controller-create a default account and API token for the new namespace.
Endpoints Controller-Management serves the endpoint object (service, pod).
Kube-scheduler
Kube-scheduler listens for requests from the newly created pod in real time through the apiserver and distributes the workload to the appropriate worker nodes. It monitors the resource utilization of all worker nodes and makes logical decisions based on the resource requirements of the new pod and the load of the existing worker nodes. Kube-scheduler also needs to consider the rules defined by the administrator (affinity and anti-affinity, constraints).
Nodes Minions-Kubernetes work node
Nodes is much simpler than the Master node and is the smallest computing unit in the cluster, simply completing the tasks assigned by the master node. If the node fails or dies, we can easily swap it with the new node to get the business back to normal. In other words, the node provides all the necessary services to run pod on it. Node nodes can be bare metal, virtual machines, OpenStack instances, or cloud instances.
The Node node consists of the following components:
Kubelet-Kuberbernets main agent
Kubelet is the primary controller in Kubernetes. It runs on each node, is the primary implementer of Pod and Node API, and enables the slave server to communicate with the master server. It registers the Node node with the cluster and monitors the Master kube- apiserver to receive instructions for work assignment. It manages the creation, modification, monitoring, deletion and other lifecycle management of the Pod on the Node node. At the same time, Kubelet periodically "reports" the status information of the Node to the API Server, and if there is a problem with the pod, it will report to the Master. Kubelet exposes a read-only port: 10255, which can obtain Kubelet monitoring status information. The port is authentication-free and unsafe.
/ spec endpoint-provides information about running nodes.
/ healthz endpoint-its health check endpoint.
/ pods endpoint-provides running pod information.
Container engine-Container Run-time
Pods packages the container into it. To deploy containers, you need container Run-time software. In most cases, it is a docker engine, but of course we can also use other container runtime software (for example, rkt). The container engine manages the container running on the pod, pulling the image for deployment and starting / stopping the container on the container.
Kube-proxy
Kube-proxy is the brain of the node node, which ensures that each pod can get a unique IP. If multiple containers are to be packaged in a pod, all containers in pod share a single IP. It also loads all pod in the service (directs access to the service IP through iptables rules and redirects to the correct back-end application, providing a highly available load balancing solution).
Pod creation process
The following figure shows the process created by pod in the worker node. Kubectl is a command-line utility where you can pass commands to the Kubernetes cluster to create and manage various Kubernetes components.
Thank you for your reading, the above is the content of "the working mechanism of Kubernetes", after the study of this article, I believe you have a deeper understanding of the working mechanism of Kubernetes, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.