Service Mesh is a solution that lets you manage communication between independent services in a microservice application. The service mesh implementation enables software developers to separate and manage service-to-service communications in dedicated infrastructure layers. Before we go into the use cases of the service mesh, let’s look at the challenges of designing a microservice and how to overcome communication barriers.
Challenges of designing a microservice architecture
Configuring a Microservice: When you migrate from a monolith application to microservices, you introduce a new set of associated challenges. For example, if you have an application made up of several microservices like the Preview component, web server, application core, database server, and hosting service, all have been deployed in your managed Kubernetes cluster like EKS.
Each component and microservice has its requests and services it handles like the web server handles the web service requests, and the database persists and handles your data logic utilities. The application core handles the requests going in and out of the pods. Every service needs to talk to each other when a user sends in a request on the preview component; a request is received by the web server, which then hands it over to the application core microservice, which will talk to the RDS database to persist the data.
Security: The environment used in setting up your microservice will have firewall rules attached to it, so the requests get sent to the proxy, and your cluster won't be accessed directly. With Service mesh configuration, every service in your infrastructure can talk freely with no restrictions with secure connections
How does the Service talk to each other
All the service endpoints that the application core and web server talk to must be configured on your web server, so when you add a new microservice, you’ll have to add the endpoint of the new service to all of the microservices that need to talk to it. With the Retry logic service on your microservices, you can make your whole application more robust and reachable. If one microservice is unreachable, the retry logic will help log all connectivity failures and continue to retry when there’s a failing operation.
Service Mesh with Sidecar Pattern
The Service Mesh side car pattern tool lets you handle all your requests logic and act as a proxy. Service Mesh has a control plane that will automatically inject the proxy in every microservice pod, and then your microservices can talk to it through those proxies.
Traffic Splitting with Service Mesh
When changes are made to a preview service, for example, you can send a percentage of traffic to the new version for some time to make sure that your workload is balanced. With traffic splitting, you can direct 20% of your traffic to the application core, 30%vtraffic to the database, etc.
Service Mesh with Istio
Service Mesh is a method used in communication, and Istio is one of its implementations. In an Istio application, the proxies are envoy proxies, and the control plane component is Istiod which manages and injects the envoy proxies in each microservice pod. The Istio architecture comprises the control plane (Istiod component) and manages the data plane, a group of all other proxies.
Istio can be configured with Kubernetes `yaml` files because it uses CRDs by extending the Kubernetes API. CRD is a custom component in Kubernetes that allows you to configure a third-party component like Istio using the same Kubernetes `yaml` files. Using the istio CRDs, you can configure different traffic routing rules between your services, like which services can talk to each other, time outs, and many other network configurations for configuring service-to-service communication. After configuring the service, Istiod converts the high-level routing rules into Envoy-specific configurations, and they can now communicate with each other effectively.
Conclusion
In this article, we talked about how to increase release flexibility, ensure high availability, and how increase service communication in your microservices. Watch out for part 2 of this series on configuring a service mesh using istio using CRDs.
Comments