Deploy Frontend/VirtualGateway

This workshop has been deprecated and archived. The new Amazon EKS Workshop is now available at

Deploy the Frontend Service

We will want to visualize the automated canary deployment, so we will use the frontend service as a UI. This frontend service will call the backend service detail to get the vendor information. In order to expose the frontend service outside the mesh, we will use AWS AppMesh VirtualGateway affiliated with Network Load Balancer. Lets deploy the frontend service.

export APP_VERSION=1.0
envsubst < flagger/frontend.yaml | kubectl apply -f - 

deployment.apps/frontend created
service/frontend created created created 

Deploy the AppMesh VirtualGateway

helm upgrade -i appmesh-gateway eks/appmesh-gateway \
	--namespace flagger \
    --set serviceAccount.create=false \
Release "appmesh-gateway" does not exist. Installing it now.
NAME: appmesh-gateway
LAST DEPLOYED: Tue Mar 23 01:58:55 2021
NAMESPACE: flagger
STATUS: deployed
AWS App Mesh Gateway installed!                                                                                   

Create the GatewayRoute

In this GatewayRoute, we are routing the traffic coming into the VirtualGateway to frontend VirtualService.

kubectl apply -f flagger/gateway.yaml created

Get all the resources for AppMesh VirtualGateway appmesh-gateway

kubectl get all  -n flagger -o wide | grep appmesh-gateway
pod/appmesh-gateway-65bc4cb47d-l6m6d      2/2     Running   0          19h   <none>           <none>

service/appmesh-gateway      LoadBalancer   80:30249/TCP   19h

deployment.apps/appmesh-gateway      1/1     1            1           19h     envoy

replicaset.apps/appmesh-gateway-65bc4cb47d      1         1         1       19h     envoy,pod-template-hash=65bc4cb47d   arn:aws:appmesh:us-east-2:$ACCOUNT_ID:mesh/flagger/virtualGateway/appmesh-gateway_flagger   19h   arn:aws:appmesh:us-east-2:$ACCOUNT_ID:mesh/flagger/virtualGateway/appmesh-gateway_flagger/gatewayRoute/frontend_flagger   19h

It takes 3 to 5 minutes to set up the Load Balancer.

Testing Setup

Find the AppMesh VirtualGateway public endpoint:

export URL="http://$(kubectl -n flagger get svc/appmesh-gateway -ojson | jq -r ".status.loadBalancer.ingress[].hostname")"
echo $URL

Wait for the NLB to become active:

watch curl -sS $URL

Once the LoadBalancer is active, access the LoadBalancer endpoint in browser lb

You can see that our frontend service is exposed via VirtualGateway using Network LoadBalancer. And this frontend service communicates with backend service detail to get the vendor information.

Congratulations on exposing the frontend service via App Mesh VirtualGateway!

Let’s test the Automated Canary Deployment for detail backend service.