In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
This series of articles will be sorted out in my Java interview Guide warehouse on GitHub. Please check out more wonderful content in my warehouse.
This article is reproduced from
Https://github.com/h3pl/Java-Tutorial
Have some trouble with Star if you like.
This series of articles will be organized on my personal blog:
Www.how2playlife.com
This series of blogs will introduce common back-end technologies, which is a comprehensive capability for back-end engineers. We will gradually learn about search technology, cloud computing-related technologies, research and development of big data and other common technologies, so as to give you a more complete picture of the back-end technology stack and prepare you for subsequent participation in distributed application development and learning.
If you have any suggestions or questions about this series of articles, you can also follow the official account [Java Technology jianghu] to contact me. You are welcome to participate in the creation and revision of this series of blog posts.
Ten minutes will take you to understand the core concepts of Kubernetes
This article will briefly introduce the core concepts of Kubernetes. Because these definitions can be found in the Kubernetes documentation, the article also avoids long, boring text introductions. Instead, we will use some diagrams (some of which are animations) and examples to explain these concepts. We find that some concepts (such as Service) are difficult to fully understand without the help of diagrams. We will also provide links to Kubernetes documents where appropriate for readers to learn more.
Container features, mirroring, network; Kubernetes architecture, core components, basic functions; Kubernetes design concepts, architecture design, basic functions, common objects, design principles; Kubernetes database, runtime, network, plug-ins have landed experience; micro-service architecture, components, monitoring solutions, etc.
Let's get started.
What is Kubernetes?
Kubernetes (k8s) is an open source platform for automating container operations, including deployment, scheduling, and expansion between node clusters. If you have ever used Docker container technology to deploy containers, think of Docker as a low-level component used internally by Kubernetes. Kubernetes supports not only Docker, but also Rocket, another container technology.
Using Kubernetes, you can:
Automate container deployment and replication expand or shrink container size at any time to organize containers into groups, and provide load balancing between containers. It is easy to upgrade a new version of the application container to provide container flexibility, replace it if the container fails, and so on.
In fact, a complete cluster of multi-tier containers (front-end, background, etc.) can be deployed with only one deployment file and one command using Kubernetes:
$kubectl create-f single-config-file.yaml
Kubectl is a command line program that interacts with Kubernetes API. Now let's introduce some core concepts.
Cluster
A cluster is a set of nodes, which can be physical servers or virtual machines, on which the Kubernetes platform is installed. The following figure shows such a cluster. Note that the diagram has been simplified to emphasize the core concepts. Here you can see a typical Kubernetes architecture diagram.
1.png
In the figure above, you can see the following components, using special icons to represent Service and Label:
PodContainer (Container) Label (label) Replication Controller (replication Controller) Service (Service) Node (Node) Kubernetes Master (Kubernetes Master) Pod
The Pod (green box above) is arranged on the node and contains a set of containers and volumes. Containers in the same Pod share the same network namespace and can use localhost to communicate with each other. Pod is transient, not a persistent entity. You may have these questions:
If Pod is short-lived, how can I persist container data so that it can exist across restarts? Yes, Kubernetes supports the concept of volumes, so persistent volume types can be used. Do you want to create Pod manually? if you want to create multiple copies of the same container, do you need to create one by one? You can create a single Pod manually, but you can also use Replication Controller to create multiple copies using Pod templates, which are described in more detail below. If the Pod is short-lived, the IP address may change when you restart, so how can you correctly and reliably point to the background container from the front-end container? You can use Service at this point, which will be described in more detail below. Lable
As shown in the figure, some Pod have Label. A Label is a key / value pair from attach to Pod that is used to pass user-defined attributes. For example, you might create a "tier" and "app" tags that mark the front-end Pod container with Label (tier=frontend, app=myapp) and the background Pod with Label (tier=backend, app=myapp). You can then use Selectors to select a Pod with a specific Label and apply Service or Replication Controller to it.
Replication Controller
Do you want to create Pod manually? if you want to create multiple copies of the same container, do you need to create them one by one? can you put the Pods into the logical group?
Replication Controller ensures that a specified number of Pod "copies" are running at any time. If you create a Replication Controller for a Pod and specify three copies, it creates three Pod and continuously monitors them. If a Pod does not respond, then Replication Controller replaces it, keeping the total to 3. 0. As shown in the following animation:
2.gif
If the previously unresponsive Pod is restored and there are now four Pod, Replication Controller will hold the total number of terminations of one of them to 3. If you change the total number of replicas to 5 in operation, replication Controller will immediately start 2 new Pod, ensuring a total of 5. You can also shrink the Pod in this way, which is useful when performing a rolling upgrade.
When creating a Replication Controller, you need to specify two things:
Pod template: the template used to create a copy of Pod the label of the Pod that Label:Replication Controller needs to monitor.
Now that you have created some copies of Pod, how do you balance the load on those copies? What we need is Service.
Service
If the Pods is short-lived, the IP address may change when you restart, so how can you correctly and reliably point to the background container from the front-end container?
Service is a layer of abstraction that defines a series of Pod and the policies that access those Pod. Service finds the Pod group through Label. Because Service is abstract, they are usually not seen in diagrams, which makes the concept more difficult to understand.
Now, suppose you have two background Pod, and the name of the background Service is defined as' backend-service',lable selector (tier=backend, app=myapp). Backend-service 's Service accomplishes two important things:
A local cluster DNS entry is created for Service, so the front-end Pod only needs DNS to find the hostname 'backend-service',' to resolve the IP addresses available to the front-end application. Now the front end has the IP address of the background service, but which of the two background Pod should it access? Service provides transparent load balancing between the two background Pod and distributes requests to either of them (as shown in the animation below). This is done through the agent (kube-proxy) running on each Node. Here are more technical details.
The following animation shows the functionality of Service. Note that the diagram makes a lot of simplification. If you do not enter the network configuration, then the underlying network and routing involved in achieving the goal of transparent load balancing are relatively advanced. If you are interested, here is a more in-depth introduction.
3.gif
There is a special type of Kubernetes Service called 'LoadBalancer', which is used as an external load balancer to balance traffic across a certain number of Pod. For example, it is useful for load balancing Web traffic.
Node
The node (orange box above) is a physical or virtual machine, as a Kubernetes worker, often referred to as Minion. Each node runs the following key Kubernetes components:
Kubelet: is the master node agent. It is used by Kube-proxy:Service to route links to Pod, as described above. The container technology used by Docker or Rocket:Kubernetes to create containers. Kubernetes Master
The cluster has a Kubernetes Master (purple box). Kubernetes Master provides a unique perspective on clustering and has a range of components, such as Kubernetes API Server. API Server provides REST endpoints that can be used to work with clusters. The master node includes the Replication Controller used to create and copy the Pod.
Next step
Now that we know the basics of the core concepts of Kubernetes, you can read the Kubernetes user manual further. The user manual provides quick and complete learning documentation.
If you can't wait to try Kubernetes, you can use Google Container Engine. Google Container Engine is a managed Kubernetes container environment. After simply registering / logging in, you can try the example above.
Original link: Learn the Kubernetes Key Concepts in 10 Minutes (translator: Cui Yuewen)
= =
Introduction to the translator
Cui Yuewen, now working in IBM, is a senior software engineer, responsible for system testing of IBM WebSphere business process management software. Used to work for VMware in quality assurance of desktop virtualization products. Strong interest in virtualization, middleware technology, business process management.
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.