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?
[[413787]] This article is reprinted from WeChat p...
As June begins, all major online platforms have l...
How to find the IP address of a router is an esse...
News on September 10: Yesterday, the Ministry of ...
Usually, you may encounter such a phenomenon duri...
Reference answer: We all know that TCP is connect...
[51CTO.com original article] On November 22, the ...
DogYun (Chinese name: 狗云) has launched a new batc...
IoT applications have penetrated into our lives, ...
[[335662]] The COVID-19 pandemic has imposed mand...
[[428843]] Since the issuance of the "Action...
In the 4G era, although "4G" and "...
ColoCrossing recently released a 50% discount cou...
After completing the C2 round of financing in Sep...
Operators generously offer "unlimited" ...