Table of Contents

Install the RabbitMQ message broker

Products: FastReport Corporate Server

To install RabbitMQ, the variable RABBITMQ_PASSWORD, containing the password needs to be defined. You can also configure the volume size for the message broker queue.

Add chart and update helm repository.

helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo update

Create a namespace for RabbitMQ.

kubectl create namespace rabbitmq

The installation of RabbitMQ can vary depending on the type of installation. Below are two examples: for the Hetzner provider and for the installation on a test configuration.

Install on Hetzner cloud hosting

The script below uses a queue size of 10 GB.

export RABBITMQ_PASSWORD="<password for RabbitMQ>"

cat <<EOF > ./rabbitmq.yaml
rabbitmq:
  extraConfiguration: |-
    #disk_free_limit.absolute = 10GB
    management.path_prefix = /rabbit
    #management.load_definitions = /app/load_definition.json
persistence:
  enabled: true
  storageClass: hcloud-volumes
  size: 10Gi
livenessProbe:
  commandOverride:
    - sh
    - -c
    - rabbitmq-api-check "http://user:\$RABBITMQ_PASSWORD@127.0.0.1:15672/rabbit/api/healthchecks/node" '{"status":"ok"}'
readinessProbe:
  commandOverride:
    - sh
    - -c
    - rabbitmq-api-check "http://user:\$RABBITMQ_PASSWORD@127.0.0.1:15672/rabbit/api/healthchecks/node" '{"status":"ok"}'
EOF

helm upgrade \
  --install rabbitmq bitnami/rabbitmq \
  --namespace=rabbitmq \
  --values ./rabbitmq.yaml

rm ./rabbitmq.yaml

Example of a minimal RabbitMQ installation to deploy on a test cluster

The configuration below uses a queue size of 4 GB. Please note, this example is the minimum for running FastReportort Corporate Server and the described volume configuration is not fail-safe.

apiVersion: v1
kind: PersistentVolume
metadata:
  namespace: "rabbitmq"
  name: pv-for-rmq
  labels:
    name: mongo-volume-1-0-0
spec:
  storageClassName: manual
  capacity:
    storage: 4Gi
  accessModes:
  - ReadWriteOnce
  hostPath:
    path: /devkube/rabbitmq
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: "rabbitmq-pvc"
  namespace: "rabbitmq"
spec:
  accessModes:
  - ReadWriteOnce
  storageClassName: manual
  resources:
    requests:
      storage: 4Gi

Run kubectl apply -f <name of yaml> and the RabbitMQ installation script. Note, that the previously created PersistentVolumeClaim is used.

helm upgrade \
  --namespace=rabbitmq \
  --install rabbitmq bitnami/rabbitmq  \
  --set persistence.existingClaim=rabbitmq-pvc \
  --set volumePermissions.enabled=true \
  --set ingress.tlsSecret="fr-corporate-tls" \
    | tee RabitMQ.txt

Add ingress configuration

This step is required if you want to access the RabbitMQ service control panel from outside the cluster.

export SERVER_DOMAIN_NAME="<server domain name>"

cat <<EOF | kubectl apply -f -
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: fastreport.cloud-rabbitmq
  namespace: rabbitmq
  annotations:
    kubernetes.io/ingress.class: "nginx"
    nginx.ingress.kubernetes.io/rewrite-target: "/\$2"
    nginx.ingress.kubernetes.io/configuration-snippet: |
      rewrite ^(/rabbit)\$ \$1/ redirect;

spec:  
  tls:
  - hosts:
    - $SERVER_DOMAIN_NAME
    secretName: fr-corporate-tls
  rules:
  - host: $SERVER_DOMAIN_NAME
    http:
      paths:      
      - path: /rabbit
        backend:
          serviceName: rabbitmq
          servicePort: 15672
EOF

Access by user ********.