To port the DJ App to App Mesh, you will need create a mesh as well as the various mesh components. You’ll also apply labels to the
prod namespace to affiliate your new mesh with it, and to enable automatic sidecar injection for pods within it.
Kubernetes application objects that run within App Mesh must be defined as
Virtual Nodes. This provides App Mesh an abstraction to objects such as Kubernetes Deployments and Services, and provides endpoints for communication and routing configuration.
App Mesh also provides the
Virtual Service construct which allows you to specify a logical service path for application traffic. In this example, they send traffic to
Virtual Routers, which then route traffic to the
In the image below you see DJ App running within App Mesh. Each of the services (
jazz-v1) has a virtual node defined, and each music category has a virtual service (
jazz). These virtual services send traffic to virtual routers within the mes, which in turn specify routing rules. This drives traffic to their respective virtual nodes and ultimately to the service endpoints within Kubernetes.
You’ll find the YAML which specify these resources in the application repo’s
Looking at the YAML, you can see we’ve added the required labels to the
prod namespace and specified our mesh named
Included are the specifications for the App Mesh resources shown in the image above. For example, here is the
Note that it uses a
podSelector to identify which
Pods are members of this virtual node, as well as a pointer to the dj
There are also
VirtualRouter specifications for each of the music categories, establishing traffic routing to their respective endpoints. This is accomplished by adding
Routes which point to the
metal-v1 virtual nodes.
Shown here is the jazz virtual service and virtual router.
With the basic constructs understood, it’s time to create the mesh and its resources.