Code360 powered by Coding Ninjas X Naukri.com. Code360 powered by Coding Ninjas X Naukri.com
Last Updated: Mar 27, 2024

Traffic Director

Leveraging ChatGPT - GenAI as a Microsoft Data Expert
Speaker
Prerita Agarwal
Data Specialist @
23 Jul, 2024 @ 01:30 PM

Introduction

In less than ten years since it started, Google Cloud Platform (GCP) has managed to establish a strong position in the cloud market and among its rivals. It is a collection of services (Cloud Computing) that utilizes the same internal infrastructure as Google's end-user products, like YouTube, Google, etc.

google cloud image

You may manage your mesh configurations. Without being concerned about the control plane's health and maintenance. Traffic Director has a 99.99 percent SLA (when reaching GA, currently in beta).

In this article, the reader will learn about the traffic director in GCP. The steps to deploy Traffic Director with Envoy on Compute Engine VMs. And traffic director for service mesh and Traffic Director capabilities.

Traffic Director

GCP's completely managed traffic control plane for service mesh is called Traffic Director. You can quickly set up advanced traffic control policies. Offload health checks from service proxies using traffic director. Install global load balancing across clusters and VM instances in many regions. You are not forced to use a proprietary interface. Traffic Director communicates with the service proxies in the data plane. 

Get the tech career you deserve, faster!
Connect with our expert counsellors to understand how to hack your way to success
User rating 4.7/5
1:1 doubt support
95% placement record
Akash Pal
Senior Software Engineer
326% Hike After Job Bootcamp
Himanshu Gusain
Programmer Analyst
32 LPA After Job Bootcamp
After Job
Bootcamp

Deploy Traffic Director with Envoy on Compute Engine VMs

  • Read Prepare to set up Traffic Director with Envoy as a starting point.
  • If you are utilizing Compute Engine VMs with automatic Envoy deployment:
  • Set up automatic Envoy deployment for Compute Engine VMs.
  • Options for setting up a Compute Engine VM with automatic deployment of Envoy.
  • Read Set up Compute Engine VMs with manual Envoy Deployment if you are using Compute Engine VMs.

Deploy Traffic Director with Envoy on GKE Pods
 

  • Read Prepare to set up Traffic Director with Envoy as a starting point.

 

  • Read the article if you are utilizing GKE Pods with automated Envoy injection:

 

  • GKE Pods should be set up with automatic Envoy injection.

 

  • Possibilities for setting up a GKE Pod with automated Envoy injection

 

  • Read Set up GKE Pods with manual Envoy Injection if you use GKE Pods with manual Envoy Injection.

 

  •  See Set up Traffic Director service security with Envoy. For establishing authentication and permission for services deployed.

Deploy Traffic Director with proxyless gRPC applications
 

  • Read, to begin with, Prepare to install gRPC services without a proxy in Traffic Director.

 

  • Read Traffic Director setup with Compute Engine VMs and proxyless gRPC services. If you use Compute Engine virtual machines.

 

  • Read Traffic Director setup with GKE and proxyless gRPC services if you use GKE Pods.
     
  • Set up Traffic Director service security with proxyless gRPC. To get information on configuring. Security service for a proxyless gRPC service mesh. Read Set up Envoy Service Security for Traffic Director.

Traffic Director for service mesh

A service mesh's fundamental function is to offer a framework. Autonomous microservices are created in various languages. And also maintained by various teams. A service mesh facilitates the separation of development and operations. Developers now use service proxies. Like Envoy and a service-mesh. Control plane to provision and dynamically manage the proxies. Instead of writing and maintaining policies and networking code within their applications.

Google Cloud's fully managed traffic control plane for service mesh. This is called Traffic Director. Traffic Director functions for both VMs and containers right out of the box. You won't ever be forced to utilize a proprietary interface. As it communicates with the service proxies in the data plane using the open source xDS APIs.

Traffic Director capabilities

Some of the traffic director capabilities are given below.

Global load balancing

For your internet-facing services, many of you employ Google's global load balancing. Internal microservices in a service mesh now have access to global load balancing. You can set up your service instances across all Google Cloud Platform (GCP) regions. By using global load balancing. Clients can send traffic to the closest service instance with capacity. Thanks to Traffic Director's intelligence. With the shortest round-trip time (RTT) per request. This maximizes global traffic distribution. Services that originate traffic and those that consume it.
 

Traffic Director provides intelligence. To redirect traffic to a healthy instance in the next closest region. Suppose the instances nearest to the client service are down or overloaded.

Centralized health-checking

Since each sidecar proxy must do a health check on every service instance in the service mesh. Big service meshes might produce a lot of health-checking traffic. Every client proxy health-checking every server instance. As the mesh expands leads to an n2 health-checking problem. Due to this, we can prevent your installations from developing and scaling.

This problem is resolved by Traffic Director. By centralizing health checks. In which every service instance is monitored by a globally distributed, resilient system. Using the EDS API, the Traffic Director. Transmits the combined health-check results to every proxy in the global mesh.

Load-based autoscaling

Autoscaling is enabled based on the load signal that proxies send to Traffic Director. Traffic Director tells the Compute Engine autoscaler of any changes in traffic. And allows the autoscaler to grow to the necessary size in a single step. Instead of multiple steps as other autoscalers do. Also, lowering the amount of time needed for the autoscaler to respond to traffic spikes.
 

Traffic Director reroutes traffic to other available instances. Even in other countries as needed. In contrast, the Compute Engine autoscaler ramps up capacity where it's needed. Traffic Director shifts traffic back to the closest zone and region. The autoscaler expands to the point where the workload can support the surge. In contrast, once more, optimizing traffic distribution to reduce per-request RTT.

Built-in resiliency

You don't need to be concerned about Traffic Director's uptime. Lifecycle management, scalability, or availability. As it is a fully managed service from GCP Infrastructure. Supporting Traffic Director is globally dispersed. Durable and runs on the same tried-and-true platforms as Google's user-facing services.  Traffic Director will provide a 99.99 percent service level agreement (SLA) (GA). 

Traffic control capabilities

Without changing the application code, Traffic Director enables you to manage traffic.

You can specify the following when creating unique traffic control rules and policies:

  • HTTP match rules: Identify the parameters in an incoming request. Such as the host, path, and headers that need to match.

 

  • HTTP actions: Tasks to be carried out upon request following a match. These consist of fault injection, mirroring, redirection, rewrites, header transformations, and more.
     
  • Per-service traffic policies: These define circuit-breaker parameters, load-balancing algorithms, and other service-specific customizations.
     
  • Filtering of configuration: The ability to push configuration to a specific group of customers.

You can get sophisticated traffic control capabilities without the usual effort. By utilizing the routing rules and traffic policies mentioned above.

Set up Google Kubernetes Engine Pods using automatic Envoy injection

Your application code does not need to be aware of your networking settings in a service mesh. Service networking is handled by a control plane that configures a data plane. Over which your applications communicate. Your control plane in this manual will be Traffic Director. And your data plane will be the Envoy sidecar proxies.

Your Google Kubernetes Engine Pods can easily install Envoy sidecar proxies. Thanks to the Envoy sidecar injector. The Envoy sidecar injector inserts a proxy. Configures the proxy to handle application traffic. And establish a connection with Traffic Director.

You will be guided through a straightforward setup by Traffic Director. In this article, with the help of Google Kubernetes Engine. These actions lay the groundwork for more complex use cases. Such as creating a service mesh that spans many Google Kubernetes Engine clusters. And perhaps even Computes Engine virtual machines.

 

The setup procedure entails:

  • Suit your workloads, establishing a GKE cluster.
  • Installing and turning on the Envoy sidecar injector.
  • Deploying a test client, then checking the injection.
  • Establishing a test Kubernetes service.
  • Setting up the Cloud Load Balancing components. In Traffic Director to direct traffic to the test service.
  • Make a request from the example client to the test service to validate the settings.

Set up Compute Engine VMs using automatic Envoy deployment

How to configure a data plane made up of Envoy sidecar proxies. Using Traffic Director deploy it automatically. And test your configuration to make sure it works. These steps are included in the process:

  • The Cloud OS Config API's activation.
  • Putting together a test service.
  • Using Envoy proxies to deploy a basic data plane on Compute Engine (Envoy version 1.18.4, which supports only xDS v3).
  • Configuring Traffic Director helps configure your Envoy sidecar proxies. By utilizing Compute Engine APIs.
  • Sending a request over an Envoy proxy. That is operating on a virtual machine to a load-balanced backend.

This document's configuration examples are provided for illustration only. Depending on your environment and requirements. You might need to deploy extra components for a production environment.

Traffic Director features

You may manage microservices in a global service mesh with the aid of the Traffic Director. The mesh takes care of networking for your microservices. Allowing you to write application code. Without having to understand the complicated underpinnings of networking. By separating application logic from networking logic. You may speed up development and boost service availability. And implement cutting-edge DevOps techniques within your company.

Your service mesh is made up of your applications. A data plane that is xDS-compatible (often the free Envoy proxy). And a mesh control plane called Traffic Director.

Use a supported version of gRPC. To deploy proxyless gRPC services with Traffic Director in your service mesh.

Frequently Asked Questions

What are Google Cloud Labs?

The Google Cloud Self-Paced Labs are interactive labs that take place online. These laboratories include a series of guidelines. That lead through a real-world, scenario-based use case in real-time.

What is the use of Qwiklabs?

To work on several cloud platforms and gain practical experience. Qwiklabs offers temporary credentials to both Google Cloud Platform and Amazon Web Services.

What is the full form of GCP?

The Google Cloud Platform (GCP) is a collection of cloud computing services. It employs the same internal Infrastructure as Google for its consumer products. Including Google Search, Gmail, Drive, and YouTube.

Is GCP PaaS or IaaS?

Despite starting only with PaaS, GCP now offers IaaS. The Infrastructure as a Service (IaaS) product Google Compute Engine (GCE). Enables users to run workloads on Google's actual Infrastructure.

Conclusion

We covered the Traffic Director in this article. We hope this article helps you to learn something new. And if you're interested in learning more. See our posts on AWS vs. Azure and Google CloudGoogle BigQueryAWS Vs Azure Vs Google Cloud: The Platform of Your Choice?, and Java knowledge for your first coding job.

Visit our practice platform. Coding Ninjas Studio to practice top problems. attempt mock tests, read interview experiences, and much more.! Feel free to upvote and share this article if it has been helpful for you.

 

 

Topics covered
1.
Introduction
2.
Traffic Director
3.
Deploy Traffic Director with Envoy on Compute Engine VMs
4.
Deploy Traffic Director with Envoy on GKE Pods 
5.
Deploy Traffic Director with proxyless gRPC applications 
6.
Traffic Director for service mesh
7.
Traffic Director capabilities
8.
Global load balancing
9.
Centralized health-checking
10.
Load-based autoscaling
11.
Built-in resiliency
12.
Traffic control capabilities
13.
Set up Google Kubernetes Engine Pods using automatic Envoy injection
14.
Set up Compute Engine VMs using automatic Envoy deployment
15.
Traffic Director features
16.
Frequently Asked Questions
16.1.
What are Google Cloud Labs?
16.2.
What is the use of Qwiklabs?
16.3.
What is the full form of GCP?
16.4.
Is GCP PaaS or IaaS?
17.
Conclusion