In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
K8S access pod how to get the real IP of the client, for this problem, this article details the corresponding analysis and solution, hoping to help more small partners who want to solve this problem find a simpler and easier way.
Keep client source IP
Because of the code implementation relationship for this feature, the source IP seen by the target container is not the source IP of the client. If you need to preserve the client source IP, you can configure the spec field for these services (supported in GCE/GKE environments):
service.spec.externalTrafficPolicy -If this service needs to route external traffic to local nodes or cluster-level endpoints, this parameter needs to be specified. There are two options: Cluster (default) and Local. Cluster hides the source IP address, which may result in a second hop to other nodes, but the global load works better. "Local" preserves the client source IP address, avoiding the second hop of LoadBalancer and NodePort type services, but may cause load imbalance.
service.spec.healthCheckNodePort -Defines the healthCheckNodePort (numeric port number) of the service. If not declared, the service API backend creates a healthCheckNodePort with the assigned nodePort. If the client specifies a nodePort, the user-defined value is used. This only works if the type is set to "LoadBalancer" and externalTrafficPolicy is set to "Local."
http://docs.kubernetes.org.cn/759.html
Note that if Serivce is of ClusterIP type, then you need to add the following to the Ingress-controller-slb service:
externalTrafficPolicy:Local
About K8S access pod how to get the answer to the client real IP questions shared here, I hope the above content can be of some help to everyone, if you still have a lot of doubts not solved, you can pay attention to the industry information channel to learn 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.