Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file.
17 changes: 17 additions & 0 deletions docs/examples/pod-anti-affinity/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Pod Anti Affinity Example

This simple pod anti affinity rule will try to assign pods to different nodes according to [Assigning Pods to Nodes](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/).

The `preferredDuringSchedulingIgnoredDuringExecution` type can be replaced by `requiredDuringSchedulingIgnoredDuringExecution` to require pod separation as in production-ready example.

You can deploy this example like this:

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

And once deployed, you can check what defaults were applied like this (`spec` section is the most important):

```shell
kubectl get -o yaml rabbitmqclusters.rabbitmq.com hello-world
```
18 changes: 18 additions & 0 deletions docs/examples/pod-anti-affinity/rabbitmq.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: rabbitmq.com/v1beta1
kind: RabbitmqCluster
metadata:
name: pod-anti-affinity
spec:
replicas: 3
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
labelSelector:
matchExpressions:
- key: app.kubernetes.io/name
operator: In
values:
- pod-anti-affinity
topologyKey: kubernetes.io/hostname
2 changes: 1 addition & 1 deletion docs/examples/production-ready/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ kubectl apply -f rabbitmq.yaml
kubectl apply -f pod-disruption-budget.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.
Please keep in mind that you need a multi-zone Kubernetes cluster with 3 nodes, 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 performance [in Google Cloud Documentation](https://cloud.google.com/compute/docs/disks/performance#ssd_persistent_disk).
10 changes: 10 additions & 0 deletions docs/examples/production-ready/rabbitmq.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,16 @@ spec:
persistence:
storageClassName: ssd
storage: "500Gi"
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app.kubernetes.io/name
operator: In
values:
- production-ready
topologyKey: kubernetes.io/hostname
override:
statefulSet:
spec:
Expand Down