- Docker
- kubectl
- Azure CLI
- Helm3
- Java JDK11
- Maven
In this sample we'll be using Azure Kubernetes Service, but you can install Dapr on any Kubernetes cluster. Run this script to deploy an AKS cluster
References:
Run this script to install Dapr on the Kubernetes cluster using Helm, or follow the steps below.
wget -q https://raw.githubusercontent.com/dapr/cli/master/install/install.sh -O - | DAPR_INSTALL_DIR="$HOME/dapr" /bin/bash
dapr init -kDapr extension for Azure Kubernetes Service (AKS) (preview) is yet another way to install Dapr on your AKS cluster.
References:
- Install the Dapr CLI
- Install Dapr on a Kubernetes cluster
- Dapr extension for Azure Kubernetes Service (AKS) (preview)
-
Run this script.
-
create the Kubernetes secret (replace *** with storage account key):
kubectl create secret generic output-queue-secret --from-literal=connectionString=********* -
Replace <storage_account_name> in deploy/blob-storage.yaml with your storage account name.
-
Create two Storage Account Queues, named "dapr-batch-queue" and "dapr-output-queue" in the same Storage Account.
-
Using Azure Portal, create a Event Grid event for the Storage Account:
References:
- Use Azure Event Grid to route Blob storage events to web endpoint (Azure portal) - Portal
- Manage Azure Storage resources - CLI
-
Create an Azure Container Registry (ACR) (Lowercase registry name is recommended to avoid warnings):
az acr create --resource-group <resource-group-name> --name <acr-name> --sku Basic
Take note of loginServer in the output.
-
Integrate an existing ACR with existing AKS clusters:
az aks update -n <cluster-name> -g <resource-group-name> --attach-acr <acr-name>
-
Change ACR loginServer and name in batch-file-processing/javabatchreceiver/batch-receiver/java-batch-receiver.sh
References: Create a private container registry using the Azure CLI
helm repo add bitnami https://charts.bitnami.com/bitnami helm repo update kubectl create ns kafka helm install dapr-kafka bitnami/kafka --wait --namespace kafka -f batch-file-processing/deploy/kafka-non-persistence.yaml
-
Deploy Dapr components:
kubectl apply -f batch-file-processing/deploy/blob-storage.yaml kubectl apply -f batch-file-processing/deploy/queue-storage.yaml kubectl apply -f batch-file-processing/deploy/output-queue.yaml kubectl apply -f batch-file-processing/deploy/messagebus.yaml kubectl apply -f batch-file-processing/deploy/subscriptions.yaml kubectl apply -f batch-file-processing/deploy/kafka-pubsub.yaml
-
Deploy Java Batch Receiver microservice:
cd batch-file-processing/javabatchreceiver/batch-receiver ./java-batch-receiver.sh cd ../../../
Check the logs for java-batch-receiver.
javabatchreceivername=$(kubectl get po --selector=app=java-batch-receiver -o jsonpath='{.items[*].metadata.name}') kubectl logs $javabatchreceivername -c java-batch-receiver -f
-
Test the application.
a. Upload a file to 'order' container storage. b. view the log output in java-batch-receiver c. view entry in 'dapr-output-queue'

