In the previous issue of k8s-Service Mesh Practice-Configuring Mesh, we explained how to configure Mesh requests within the cluster. Istio can also handle external traffic of the cluster, which is our common gateway. picture In fact, it is similar to the previously mentioned k8s entry to actual combat-using Ingress Ingress, which is a method of exposing internal services. Just using Istio-gateway is more flexible. picture Here is a function comparison chart, which clearly shows that Istio-gateway supports more functions. If you are a medium or large enterprise that has already used Istio, it is still recommended to have Istio-gateway, so that you can manage internal and external network traffic using the same control plane. Creating a GatewayBefore we get started, we first need to create an Istio-Gateway resource: The label that matches the selector can be associated with the gateway that comes with Istio when we install it. picture This Gateway component will be installed when we install Istio for the first time. This configuration means that the gateway will proxy all requests accessed through the domain name www.service1.io. After that, we need to use the gateway just now to bind to the service of our service. At this time, we need to use VirtualService: This is the same VirtualService configuration used for the internal traffic of the Mesh we talked about earlier. This means that traffic passing through www.service1.io and the istio-ingress-gateway gateway will enter this virtual service, but all requests will enter the subset: v1 group. This grouping information can be found in the previous section: Then we visit this domain name to get a response. At the same time, we open the Pod of the k8s-combat-service-istio-mesh service to view the log and find that all requests enter v1. If this restriction is not required, delete subset: v1. The local host needs to be configured: 127.0.0.1 www.service1.io picture Another point is that we need to get the external IP of the gateway to bind the IP to the domain name www.service1.io just now (host, or domain name management console). If you are using the kubernetes cluster that comes with docker-desktop, you can directly use 127.0.0.1, which will be bound by default. If you use minikube to install, you need to use minikube tunnel to manually bind a local IP to the service of type LoadBalancer. For details, please refer to the document: https://minikube.sigs.k8s.io/docs/tasks/loadbalancer
principlepicture The access request process is similar to the Kubernetes Ingress process mentioned earlier, except that the gateway is a service routed by VirtualService, and many routing rules can be customized in this VirtualService. SummarizeThe service mesh Istio has been basically introduced. In the future, trace, log, and metrics related to Telemetry will be updated in the operation and maintenance chapter, which will also be related to Istio. Interested friends can continue to pay attention. All source code of this article can be accessed here: https://github.com/crossoverJie/k8s-combat |
<<: Smartpedia | What is a quantum network?
On August 5, the "F5G Era Huawei Enterprise ...
The cost of NB-IoT, especially the module cost, h...
LOCVPS (Global Cloud) has launched a special prom...
【51CTO.com Quick Translation】 "I didn't ...
Today, the China Academy of Information and Commu...
2019 is the first year of 5G, but SoC and 5G base...
[Original article from 51CTO.com] On November 29t...
ZJI has released this year's Double 11 promot...
According to CCTV Finance, starting at 11:20 a.m....
[[347892]] 101 Switch Protocol 200 OK 201 Created ...
If you've ever bought a Wi-Fi router, you pro...
spinservers launched a special promotion during t...
LOCVPS launched a 1Gbps port Hong Kong VPS host b...
In nine days, China's 5G commercialization wi...
Although 5G has only been implemented for a year,...