Skip to content

Commit

Permalink
Merge pull request #401 from rabbitmq/production-example
Browse files Browse the repository at this point in the history
An example of a production cluster configuration.
  • Loading branch information
gerhard committed Nov 4, 2020
2 parents 7620e52 + 6058344 commit 3c93b46
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 0 deletions.
19 changes: 19 additions & 0 deletions docs/examples/production-ready/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Production Example

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.

Please keep in mind that:

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.

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.

You can deploy this example like this:

```shell
kubectl apply -f rabbitmq.yaml
```

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.

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).
34 changes: 34 additions & 0 deletions docs/examples/production-ready/rabbitmq.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
apiVersion: rabbitmq.com/v1beta1
kind: RabbitmqCluster
metadata:
name: production-ready
spec:
replicas: 3
resources:
requests:
cpu: 4
memory: 10Gi
limits:
cpu: 4
memory: 10Gi
rabbitmq:
additionalConfig: |
cluster_partition_handling = ignore
vm_memory_high_watermark_paging_ratio = 0.99
disk_free_limit.relative = 1.0
persistence:
storageClassName: ssd
storage: "500Gi"
override:
statefulSet:
spec:
template:
spec:
containers: []
topologySpreadConstraints:
- maxSkew: 1
topologyKey: "topology.kubernetes.io/zone"
whenUnsatisfiable: DoNotSchedule
labelSelector:
matchLabels:
app.kubernetes.io/component: rabbitmq
12 changes: 12 additions & 0 deletions ssd-gke.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# This example is GKE specific, other Kubernetes deployments will have a different `storageClass` for SSD disks.
#
# https://cloud.google.com/kubernetes-engine/docs/how-to/persistent-volumes/ssd-pd
# https://cloud.google.com/compute/docs/disks/performance#ssd_persistent_disk
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: ssd
provisioner: kubernetes.io/gce-pd
parameters:
type: pd-ssd

0 comments on commit 3c93b46

Please sign in to comment.