Skip to content

Commit 3c93b46

Browse files
authored
Merge pull request #401 from rabbitmq/production-example
An example of a production cluster configuration.
2 parents 7620e52 + 6058344 commit 3c93b46

File tree

3 files changed

+65
-0
lines changed

3 files changed

+65
-0
lines changed
+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Production Example
2+
3+
This is an example of a good starting point for a production RabbitMQ deployment. It deploys a 3-node cluster with enough resources to handle reasonable traffic.
4+
5+
Please keep in mind that:
6+
7+
1. It may not be suitable for YOUR production deployment. Please go through the [Production Checklist](https://www.rabbitmq.com/production-checklist.html) to learn more about production deployment considerations.
8+
9+
2. While it is important to correctly deploy RabbitMQ cluster for production deployment, it is even more important to correctly use RabbitMQ from your applications. [Production Checklist](https://www.rabbitmq.com/production-checklist.html) covers some of the common issues such as connection churn and polling cunsumers. Please also consider using [Quorum Queues](https://www.rabbitmq.com/quorum-queues.html) since they provide better data safety.
10+
11+
You can deploy this example like this:
12+
13+
```shell
14+
kubectl apply -f rabbitmq.yaml
15+
```
16+
17+
Please keep in mind that you need a multi-zone Kubernetes cluster with 12 CPUs, 30Gi RAM, 1.5Ti disk space available as well as a `storageClass` called `ssd` to deploy this example as-is. Of course you can adjust these values to your environment if needed.
18+
19+
An SSD storage class can be defined using [the example](ssd-gke.yaml) (which is GKE-specific and needs to be adjusted for other environments). Read more about the expected disk perforamnce [in Google Cloud Documentation](https://cloud.google.com/compute/docs/disks/performance#ssd_persistent_disk).
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
apiVersion: rabbitmq.com/v1beta1
2+
kind: RabbitmqCluster
3+
metadata:
4+
name: production-ready
5+
spec:
6+
replicas: 3
7+
resources:
8+
requests:
9+
cpu: 4
10+
memory: 10Gi
11+
limits:
12+
cpu: 4
13+
memory: 10Gi
14+
rabbitmq:
15+
additionalConfig: |
16+
cluster_partition_handling = ignore
17+
vm_memory_high_watermark_paging_ratio = 0.99
18+
disk_free_limit.relative = 1.0
19+
persistence:
20+
storageClassName: ssd
21+
storage: "500Gi"
22+
override:
23+
statefulSet:
24+
spec:
25+
template:
26+
spec:
27+
containers: []
28+
topologySpreadConstraints:
29+
- maxSkew: 1
30+
topologyKey: "topology.kubernetes.io/zone"
31+
whenUnsatisfiable: DoNotSchedule
32+
labelSelector:
33+
matchLabels:
34+
app.kubernetes.io/component: rabbitmq

ssd-gke.yaml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# This example is GKE specific, other Kubernetes deployments will have a different `storageClass` for SSD disks.
2+
#
3+
# https://cloud.google.com/kubernetes-engine/docs/how-to/persistent-volumes/ssd-pd
4+
# https://cloud.google.com/compute/docs/disks/performance#ssd_persistent_disk
5+
apiVersion: storage.k8s.io/v1
6+
kind: StorageClass
7+
metadata:
8+
name: ssd
9+
provisioner: kubernetes.io/gce-pd
10+
parameters:
11+
type: pd-ssd
12+

0 commit comments

Comments
 (0)