Anti-affinity Rules

Any plans for implementing anti-affinity into the Couchbase Kubernetes Operator based cluster deployments?

I’m looking for something similar to the Redis example in this document.

I have 6 kubernetes worker nodes in a test environment and when I increased my couchbase cluster from 3 nodes to 6 nodes a couple of the couchbase nodes ended up on the same worker nodes creating single points of failure.

I tried introducing the anti-affinity attributes to the couchbase-cluster.yaml but they don’t appear to get forwarded through to the deployed pods.

Hey @k3nnyP,

The Couchbase Autonomous Operator actually has support for Anti-Affinity built-in.

You can enable it by using the antiAffinity attribute in your cluster deployment as detailed in

Let me know if this works for you, it definitely works in all the environments I’ve tested it in.


Working like a charm. The 6 CB nodes deployed on separate worker nodes. I added a 7th CB node and it did not deploy until after I added a 7th worker node. It also reduced CB nodes as I removed worker nodes. This is exactly what I was looking for.


That’s good to hear @k3nnyP!!

@k3nnyP can you tell us where are you testing it - on physical machines, VMs, Cloud instances ?

IBM Cloud Kubernetes Service