Test the Application

Testing the Connectivity between Fargate and Nodegroup pods

To test if our ported Product Catalog App is working as expected, we’ll first exec into the frontend-node container.

export FE_POD_NAME=$(kubectl get pods -n prodcatalog-ns -l app=frontend-node -o jsonpath='{.items[].metadata.name}') 

kubectl -n prodcatalog-ns exec -it ${FE_POD_NAME} -c frontend-node bash

You will see a prompt from within the frontend-node container.


root@frontend-node-9d46cb55-XXX:/usr/src/app#

curl to Fargate prodcatalog backend endpoint and you should see the below response

curl http://prodcatalog.prodcatalog-ns.svc.cluster.local:5000/products/ 

{
    "products": {},
    "details": {
        "version": "1",
        "vendors": [
            "ABC.com"
        ]
    }
}

Exit from the frontend-node container exec bash. Now, To test the connectivity from Fargate service prodcatalog to Nodegroup service proddetail, we’ll first exec into the prodcatalog container.

export BE_POD_NAME=$(kubectl get pods -n prodcatalog-ns -l app=prodcatalog -o jsonpath='{.items[].metadata.name}') 

kubectl -n prodcatalog-ns exec -it ${BE_POD_NAME} -c prodcatalog bash

You will see a prompt from within the prodcatalog container.


root@prodcatalog-98f7c5f87-xxxxx:/usr/src/app#
curl to Nodegroup proddetail backend endpoint and you should see the below response. You can now exit from prodcatalog exec bash.

curl http://proddetail.prodcatalog-ns.svc.cluster.local:3000/catalogDetail

{"version":"1","vendors":["ABC.com"]}

Congratulations on deploying the initial Product Catalog Application architecture!

Before we create the App Mesh-enabled versions of Product Catalog App, we’ll first install the AWS App Mesh Controller for Kubernetes into our cluster.