In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article shows you how to access Service through the external network. The content is concise and easy to understand. It will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.
In addition to being able to access Service within Cluster, in many cases we also want the Service of the application to be exposed to the outside of Cluster. Kubernetes provides several types of Service, and the default is ClusterIP.
ClusterIP
Service provides services through the IP inside the Cluster, and only nodes and Pod within the Cluster can access it. This is the default Service type. The Service in the previous experiment is all ClusterIP.
NodePort
Service provides services through the static port of the Cluster node. Cluster can be accessed externally through: Service.
LoadBalancer
Service uses cloud provider's unique load balancer to provide services, and cloud provider is responsible for directing load balancer traffic to Service. Currently, cloud provider supports GCP, AWS, Azur and so on.
Let's practice modifying the configuration file of NodePort,Service httpd-svc as follows:
Add type: NodePort and recreate the httpd-svc.
Let's test whether NodePort is working properly.
The meaning of the rule is: the request to access port 32312 of the current node applies the rule KUBE-SVC-RL3JAE4GN7VOGDGP, which is as follows:
There are now three Port in the configuration file:
NodePort is the port that listens on the node.
Port is the port on which to listen on ClusterIP.
TargetPort is the port on which Pod listens.
Eventually, requests received by Node and ClusterIP on their respective ports are forwarded to Pod's targetPort through iptables.
Apply the new nodePort and verify:
NodePort: 30000 is already in effect.
We discussed the mechanism for accessing applications, Service, and learned how to create three types of Service;Service, ClusterIP, NodePort, and LoadBalancer, and their respective applicable scenarios.
The above content is how the external network accesses Service. Have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.
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: 205
*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.