⛰️
Application Platform
  • Treetracker Tech Stack
  • Best Practices
  • Team Vision
  • DevOps Notes
    • Rollback Procedures
    • Troubleshooting
    • CI-CD
  • Roadmap 2
  • RabbitMQ
  • Airflow
  • CKAN
    • CKAN
    • Cloud Settings
  • DevOps
    • Github Actions To Do
    • Alerting To Do
    • Check and recover
      • Check script
      • Check database
      • How to backup postgresql
  • Keycloak
    • Keycloak
    • How to set up Keycloak to allow login by Social Media
Powered by GitBook
On this page
  • Configuration
  • Resources
  • Running RabbitMQ on Docker Kubernetes

Was this helpful?

RabbitMQ

Instructions for setup of rabbitmq on local docker desktop

PreviousRoadmap 2NextAirflow

Last updated 1 year ago

Was this helpful?

Configuration

Until requirements make more advanced configurations necessary, the following patterns shall be followed:

  • All message producers and consumers shall use the default direct exchange, named 'amq.direct'

  • Queues are created and bound to amq.direct by consumer microservices

    • In most cases the default routing is enough. Default routing states that the queue name and routing key are a direct match.

  • Producers emit messages with documented routing keys

Resources

Terraform configuration

Running RabbitMQ on Docker Kubernetes

Required

  • Docker Desktop with Kubernetes Enabled

  • kubectl

How to run

In the deployment folder the deploy-dev.sh file contains the scripts to set up the RabbitMQ cluster and PodMonitor for the RabbitMQ pods.

Since we're running on local docker-desktop kubernetes cluster, we'll need to change the name cluster name in the deploy-dev.sh.

# kubectl config use-context do-sfo2-dev-k8s-treetracker
kubectl config use-context docker-desktop

Install CRDs

RabbitmqCluster CRD

kubectl apply -f https://github.com/rabbitmq/cluster-operator/releases/latest/download/cluster-operator.yml

PodMonitor CRD

LATEST=$(curl -s https://api.github.com/repos/prometheus-operator/prometheus-operator/releases/latest | jq -cr .tag_name) curl -sL https://github.com/prometheus-operator/prometheus-operator/releases/download/${LATEST}/bundle.yaml | kubectl create -f - 

Create Namespace

Background on rabbitmq configuration:

Fork/Clone the current Greenstand , the code for the Greenstand RabbitMQ infrastructure is in the RabbitMQ folder

For Rabbitmq Greenstand is using the "rabbitmq-cluster" namespace, to create the namespace on your docker kubernetes cluster refer to the docs .

https://www.cloudamqp.com/blog/part4-rabbitmq-for-beginners-exchanges-routing-keys-bindings.html
Greenstand Infrastructure Repo
here
Terraform Registry
Logo