Create App Mesh Resources

We are now going to the the following App Mesh resources for our PodInfo application:

  • Virtual Nodes - for our existing PodInfo services (physical) and also for our new “virtual” backend service
  • Virtual Service - defines a new “virtual” service for the backend that will distribute traffic between the existing v1 and v2 backend PodInfo services/pods

To do this download the yaml files into the apps folder:

# Virtual nodes
curl -o apps/2-podinfo-virtual-nodes.yaml

# Virtual Services
curl -o apps/3-podinfo-virtual-services.yaml

# Placeholder services
curl -o apps/4-podinfo-placeholder-services.yaml

You folder structure should look similar to:

├── amazon-cloudwatch
│   ├── cwagent-fluentd-quickstart.yaml
│   └── cwagent-prometheus-eks.yaml
├── appmesh-system
│   ├── appmesh-controller.yaml
│   ├── appmesh-inject.yaml
│   ├── appmesh-prometheus.yaml
│   └── crds.yaml
├── apps
│   ├── 1-podinfo.yaml
│   ├── 2-podinfo-virtual-nodes.yaml
│   ├── 3-podinfo-virtual-services.yaml
│   └── 4-podinfo-placeholder-services.yaml
├── namespaces
│   ├── amazon-cloudwatch.yaml
│   ├── appmesh-system.yaml
│   └── apps.yaml

Add and then commit the 3 file and push the the changes to your GitHub repo.

Flux will now see that the desired state of the apps namespace has changed in Git and will apply the resources to our cluster. This will take up to 1 minute to apply.

Check that that the deployment and services has been created by running the following command:

kubectl get virtualservices,virtualnodes,svc -n apps

You should see the new resources:   26s

NAME                                             AGE      26s   26s   26s     26s

NAME                         TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)             AGE
service/backend-podinfo      ClusterIP   <none>        9898/TCP            26s
service/backend-podinfo-v1   ClusterIP    <none>        9898/TCP,9999/TCP   3m29s
service/backend-podinfo-v2   ClusterIP   <none>        9898/TCP,9999/TCP   3m29s
service/frontend-podinfo     ClusterIP    <none>        9898/TCP,9999/TCP   3m29s