In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
How to access Pod through Service, aiming at this problem, this article introduces the corresponding analysis and answer in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible method.
We should not expect Kubernetes Pod to be robust, but rather assume that containers in Pod are likely to die from failures for a variety of reasons. Controller such as Deployment will dynamically create and destroy Pod to ensure the robustness of the application as a whole. In other words, Pod is fragile, but the application is robust.
Each Pod has its own IP address. When controller replaces the failed Pod with a new Pod, the new Pod is assigned a new IP address. This creates a problem:
If a group of Pod provides services (such as HTTP) and their IP is likely to change, how can the client find and access the service?
The solution given by Kubernetes is Service.
Create Service
Kubernetes Service logically represents a set of Pod, specifically which Pod is selected by label. Service has its own IP, and the IP is unchanged. The client only needs to access the IP,Kubernetes of Service and is responsible for establishing and maintaining the mapping relationship between Service and Pod. No matter how the back-end Pod changes, it will not have any impact on the client, because the Service has not changed.
To look at an example, create the following Deployment:
We started three Pod and ran the httpd image. The label is run: httpd,Service will use this label to pick the Pod.
Next, create a Service with the following configuration file:
Httpd-svc is assigned to a CLUSTER-IP 10.99.229.179. The back-end httpd Pod can be accessed through this IP.
Endpoints lists three IP and ports for Pod. We know that Pod's IP is configured in the container, so where is Service's Cluster IP configured? How does CLUSTER-IP map to Pod IP?
This is the answer to the question about how to access Pod through Service. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel for more related knowledge.
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.