Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the relevant knowledge points of kubernetes

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

This article will explain in detail what are the relevant knowledge points about kubernetes, the editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.

A preliminary study of kubernetes

The preliminary study has learned a few points, such as the simple schematic diagram drawn above.

1 what is RC?

RC is the abbreviation of replication controller. We can understand it as a copy controller, which means that as many copies as we set our friends, it can automatically control the number of copies, delete more and add more automatically.

2 what is POD?

POD is the smallest control unit of K8s. But POD is not a container. Multiple containers can be contained in a POD. Think of POD as a pea pod with multiple beans lying in it. These beans share IP, share resources, and the processes are visible to each other.

3 how does RC manage POD?

Label. Tags are widely used in k8s. There is no direct correlation between RC and pod, but is linked by tags. As long as the tag on POD and the tag selector in RC can match the number, then RC can control you (add, delete, modify and check), so I call RC as the chief manager in the above picture.

4 how is the access between POD? What is service?

The life cycle of POD is not long, due to firmware reasons, application reasons, generating force requirements and other reasons may affect the life and death of POD. Each time POD is reborn, its own IP changes automatically, which makes it difficult to access it. As a result, the service application is born.

Service also manages the pod within its jurisdiction through the tag. Service generates a virtual IP and port, and other POD values need to access the virtual IP and port of service to access POD within the service jurisdiction. But how does the following POD know what the virtual IP address and port of your service are? When the later POD is created, K8s will automatically write the IP address and port of the above service into the POD as an environment variable, and the later POD only needs to access the environment variable.

4.1When the following pod adds the environment variable of the previous service, the environment variable name is regular.

4.1.1 the virtual IP address of service is added to the subsequent pod with environment variables

The environment variable (hostname) {SVCNAME} _ SERVICE_HOST for the IP address, where {SVCNAME} is the name of the service.

If there is an underscore "-" in {SVCNAME}, it will become an underscore "_" in the environment variable after adding the environment variable.

For example: find service first

Then find the pod corresponding to service.

Then look at the environment variables in pod

4.4.2 the virtual port of service is added to the environment variables of subsequent pod with environment variables

Environment variable {SVCNAME} _ SERVICE_PORT corresponding to the port address

{SVCNAME} is the same as the rule described in 4.4.1 above, it is the name of the preceding service, and the underscore "-" will change to an underscore "_".

For example

This is the end of this article on "what are the relevant knowledge points of kubernetes?". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report