AKS Dapr rabbitMQ component - Daprd Sidecar not running

97 Views Asked by At

I have rabbitMQ running on http://xyzip:5672 and credentials sampleusername, samplepassword, created the rabbitMQ component yaml file created.

apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
  name: componentName
  namespace: samplenamespace
spec:
 type: pubsub.rabbitmq
 version: v1
 metadata:
 - name: connectionString
   value: "amqp://xyzip:5672"
 - name: protocol
   value: amqp
 - name: hostname
   value: 10.22.39.162
 - name: username
   value: sampleusername
 - name: password
   value: samplepassword
 - name: consumerID
   value: pubsub-subscriber
 - name: durable
   value: false
 - name: deletedWhenUnused
   value: false
 - name: autoAck
   value: false
 - name: deliveryMode
   value: 0
 - name: requeueInFailure
   value: false
 - name: prefetchCount
   value: 0
 - name: reconnectWait
   value: 0
 - name: concurrencyMode
   value: parallel
 - name: publisherConfirm
   value: false
 - name: enableDeadLetter # Optional enable dead Letter or not
   value: true
 - name: maxLen # Optional max message count in a queue
   value: 3000
 - name: maxLenBytes # Optional maximum length in bytes of a queue.
   value: 10485760
 - name: exchangeKind
   value: fanout
 - name: saslExternal
   value: false
 - name: ttlInSeconds
   value: 60
 - name: clientName
   value: pubsub-subscriber
 - name: heartBeat
   value: 10s

The dapr service sidecar is giving below error.

Fatal error from runtime: process component dapr-pubsub error: [INIT_COMPONENT_FAILURE]: initialization error occurred for dapr-pubsub (pubsub.rabbitmq/v1): init timeout for component dapr-pubsub (pubsub.rabbitmq/v1) exceeded after 5s

1

There are 1 best solutions below

0
Arko On

In-order to configure rabbitMQ on AKS, kindly follow below steps- Here I will be using bitnami charts for rabbitMQ for the setup.

  1. Assuming that you have a working AKS cluster with helm installed on it as below. enter image description here

enter image description here

  1. Run helm list command to verify if any charts already present. If not, you will search for the rabbitmq repo using helm search repo rabbitmq , add the repo using helm repo add bitnami https://charts.bitnami.com/bitnami, update the repo to keep things upto-date using helm repo update and verify your rabbitMQ details using helm show values bitnami/rabbitmq

  2. Now install the rabbitMQ using helm install my-release bitnami/rabbitmq. enter image description here enter image description here

  3. Once installed, you will get your login credentials on your screen. Save them and map your ports as shown above using kubectl port-forward --namespace default svc/my-release-rabbitmq 15672:15672 Once the port is mapped, you should see something like this- enter image description here

Now go to your browser and type localhost:15672 and you are on the login page of rabbitMQ enter image description here

  1. Key in the credentials which you have saved from your previous step and you have successfully logged into rabbitMQ dashboard. enter image description here

In order to install dapr on your AKS Follow the below steps- Here I am using helm charts instead of dapr CLI and I will be installing version 1.12.

helm repo add dapr https://dapr.github.io/helm-charts/
helm repo update

Once the repo is downloaded, verify the available version using

helm search repo dapr --devel --versions

enter image description here

Install dapr with your preferred version.

helm upgrade --install dapr dapr/dapr --version=1.12 --namespace dapr-system --create-namespace --set global.ha.enable=true --wait

Now if you check, dapr is installed enter image description here

and pods are active enter image description here

When encountering a Fatal error from runtime indicating an initialization timeout for a Dapr component, it's important to narrow down the issue systematically. Below are the steps to diagnose and potentially resolve the problem with your Dapr RabbitMQ pub/sub component: Start by ensuring that your RabbitMQ instance is running and reachable from your AKS cluster:

kubectl run -it --rm --image=busybox --restart=Never rabbitmq-test -- \
sh -c 'nc -vz xyzip 5672'

If the connection fails, your RabbitMQ instance might not be accessible from within the cluster, or the service address/port might be incorrect. Next, check the logs of the Dapr sidecar container for more detailed error messages:

kubectl logs <your-pod-name> -c daprd -n <namespace>

Also ensure there are no AKS network policies or Azure Network Security Groups blocking communication between the Dapr sidecar and RabbitMQ:

kubectl describe netpol --all-namespaces

Reference documents- MS Doc Dapr Doc Rabbitmq Doc