From c8be0b39b3f891cc259236448df102b9cafcd6d1 Mon Sep 17 00:00:00 2001 From: Michal Kuratczyk Date: Tue, 20 Oct 2020 17:21:05 +0200 Subject: [PATCH 1/4] An example of a production cluster configuration. Closes #398 --- docs/examples/production/README.md | 17 +++++++++++++ docs/examples/production/rabbitmq.yaml | 34 ++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 docs/examples/production/README.md create mode 100644 docs/examples/production/rabbitmq.yaml diff --git a/docs/examples/production/README.md b/docs/examples/production/README.md new file mode 100644 index 000000000..b80543d83 --- /dev/null +++ b/docs/examples/production/README.md @@ -0,0 +1,17 @@ +# 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 6 CPUs, 24Gi RAM, 384Gi 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. diff --git a/docs/examples/production/rabbitmq.yaml b/docs/examples/production/rabbitmq.yaml new file mode 100644 index 000000000..c285de962 --- /dev/null +++ b/docs/examples/production/rabbitmq.yaml @@ -0,0 +1,34 @@ +apiVersion: rabbitmq.com/v1beta1 +kind: RabbitmqCluster +metadata: + name: production +spec: + replicas: 3 + resources: + requests: + cpu: 2 + memory: 8Gi + limits: + cpu: 2 + memory: 8Gi + rabbitmq: + additionalConfig: | + cluster_partition_handling = ignore + vm_memory_high_watermark_paging_ratio = 0.99 + disk_free_limit.relative = 1.0 + persistence: + storageClassName: ssd + storage: "128Gi" + override: + statefulSet: + spec: + template: + spec: + containers: [] + topologySpreadConstraints: + - maxSkew: 1 + topologyKey: zone + whenUnsatisfiable: DoNotSchedule + labelSelector: + matchLabels: + app.kubernetes.io/component: rabbitmq From 30c66272ddfa2b44c04197bafc9829b0ef6a0a14 Mon Sep 17 00:00:00 2001 From: Michal Kuratczyk Date: Fri, 23 Oct 2020 14:41:47 +0200 Subject: [PATCH 2/4] Use the well-known topologyKey --- docs/examples/production/rabbitmq.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/examples/production/rabbitmq.yaml b/docs/examples/production/rabbitmq.yaml index c285de962..745cb429d 100644 --- a/docs/examples/production/rabbitmq.yaml +++ b/docs/examples/production/rabbitmq.yaml @@ -27,7 +27,7 @@ spec: containers: [] topologySpreadConstraints: - maxSkew: 1 - topologyKey: zone + topologyKey: "topology.kubernetes.io/zone" whenUnsatisfiable: DoNotSchedule labelSelector: matchLabels: From 2bb6bd7c8584e5a4d45987dd27a3b7b2ce5253a3 Mon Sep 17 00:00:00 2001 From: Michal Kuratczyk Date: Tue, 3 Nov 2020 14:35:40 +0100 Subject: [PATCH 3/4] bump resources --- docs/examples/production/README.md | 2 +- docs/examples/production/rabbitmq.yaml | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/examples/production/README.md b/docs/examples/production/README.md index b80543d83..f03ba89b3 100644 --- a/docs/examples/production/README.md +++ b/docs/examples/production/README.md @@ -14,4 +14,4 @@ You can deploy this example like this: kubectl apply -f rabbitmq.yaml ``` -Please keep in mind that you need a multi-zone Kubernetes cluster with 6 CPUs, 24Gi RAM, 384Gi 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. +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. diff --git a/docs/examples/production/rabbitmq.yaml b/docs/examples/production/rabbitmq.yaml index 745cb429d..87399d5a0 100644 --- a/docs/examples/production/rabbitmq.yaml +++ b/docs/examples/production/rabbitmq.yaml @@ -6,11 +6,11 @@ spec: replicas: 3 resources: requests: - cpu: 2 - memory: 8Gi + cpu: 4 + memory: 10Gi limits: - cpu: 2 - memory: 8Gi + cpu: 4 + memory: 10Gi rabbitmq: additionalConfig: | cluster_partition_handling = ignore @@ -18,7 +18,7 @@ spec: disk_free_limit.relative = 1.0 persistence: storageClassName: ssd - storage: "128Gi" + storage: "500Gi" override: statefulSet: spec: From 6058344ad09c8ff0dbde8b800503c0887e8a47a1 Mon Sep 17 00:00:00 2001 From: Michal Kuratczyk Date: Wed, 4 Nov 2020 17:16:16 +0100 Subject: [PATCH 4/4] Add SSD storageClass example --- .../{production => production-ready}/README.md | 2 ++ .../{production => production-ready}/rabbitmq.yaml | 2 +- ssd-gke.yaml | 12 ++++++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) rename docs/examples/{production => production-ready}/README.md (80%) rename docs/examples/{production => production-ready}/rabbitmq.yaml (96%) create mode 100644 ssd-gke.yaml diff --git a/docs/examples/production/README.md b/docs/examples/production-ready/README.md similarity index 80% rename from docs/examples/production/README.md rename to docs/examples/production-ready/README.md index f03ba89b3..c8c0e1c54 100644 --- a/docs/examples/production/README.md +++ b/docs/examples/production-ready/README.md @@ -15,3 +15,5 @@ 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). diff --git a/docs/examples/production/rabbitmq.yaml b/docs/examples/production-ready/rabbitmq.yaml similarity index 96% rename from docs/examples/production/rabbitmq.yaml rename to docs/examples/production-ready/rabbitmq.yaml index 87399d5a0..70104e0eb 100644 --- a/docs/examples/production/rabbitmq.yaml +++ b/docs/examples/production-ready/rabbitmq.yaml @@ -1,7 +1,7 @@ apiVersion: rabbitmq.com/v1beta1 kind: RabbitmqCluster metadata: - name: production + name: production-ready spec: replicas: 3 resources: diff --git a/ssd-gke.yaml b/ssd-gke.yaml new file mode 100644 index 000000000..909764be8 --- /dev/null +++ b/ssd-gke.yaml @@ -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 +