Skip to main content Link Menu Expand (external link) Document Search Copy Copied

Deploying service invocation to Azure Kubernetes Service

Table of contents

In this assignment, you will deploy the service communication to Azure Kubernetes Service (AKS). You will use the service invocation building block provided by Dapr.

Pre-requisites

Step 1: Deploy service invocation to AKS

  1. Open deploy/vehicleregistrationservice.yaml in your code editor and uncomment the following lines:

         # annotations:
             # dapr.io/enabled: "true"
             # dapr.io/app-id: "vehicleregistrationservice"
             # dapr.io/app-port: "6002"
    

    to give Vehicle Registration Service an id and a port known to Dapr.

  2. Delete the image from local docker and from the Azure Container Registry:

     docker rmi fine-collection-service:1.0-SNAPSHOT
     az acr repository delete -n $CONTAINER_REGISTRY --image fine-collection-service:latest
    

    Where $CONTAINER_REGISTRY is the name of your Azure Container Registry.

  3. In the root folder of FineCollectionService, run the following command to build and push the image:

     mvn spring-boot:build-image
     docker tag fine-collection-service:1.0-SNAPSHOT $CONTAINER_REGISTRY.azurecr.io/fine-collection-service:latest
     docker push $CONTAINER_REGISTRY.azurecr.io/fine-collection-service:latest
    

    Where $CONTAINER_REGISTRY is the name of your Azure Container Registry.

  4. From the root folder of the repo, run the following command:

     kubectl apply -k deploy
    

Step 2. Test the applications running in AKS

  1. Run the following command to identify the name of each microservice pod:

     kubectl get pods
    
  2. l\Look at the log file of each application pod to see the same output as seen when running on your laptop. For example:

     kubectl logs finecollectionservice-ccf8c9cf5-vr8hr -c fine-collection-service
    
  3. Delete all application deployments:

     kubectl delete -k deploy
    

Cleanup

When the workshop is done, please follow the cleanup instructions to delete the resources created in this workshop.

< Invoke Service using Dapr