Skip to content

Conversation

@paapug
Copy link
Contributor

@paapug paapug commented Jul 2, 2021

This PR adds podAntiAffinity example and modifies the existing procudtion-ready example so that the pods will not be scheduled on the same node. This should ensure higher availability in any Kubernetes cluster.

The pod-anti-affinity example uses preferredDuringSchedulingIgnoredDuringExecution type, while production-ready example uses requiredDuringSchedulingIgnoredDuringExecution as no production cluster should have potential one point of failure (i.e. one node).

Copy link
Member

@MirahImage MirahImage left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution!

@mkuratczyk
Copy link
Contributor

@MrPsycho5 can you explain why the changes to the production example are necessary? It already includes topologySpreadConstraint to make sure RabbitMQ nodes run in different AZs, which by extension also requires them to run on different Kubernetes nodes. Unless I'm missing something we should use one or the other but not both because:

  1. users with multiple AZs don't need this additional anti-affinity rule
  2. users with a single AZ need to remove the topologySpreadConstratint anyway (otherwise the pods can't be scheduled)

Thanks,

@paapug
Copy link
Contributor Author

paapug commented Jul 5, 2021

I have the following situations in my mind:

  1. User has 3 availability zones, 5+ nodes and 5 rabbit replicas. We should not only make sure the replicas are spread across different availability zones, but also different nodes within single zone.
    Perhaps we should also change DoNotSchedule to ScheduleAnyway to allow for such situation.

  2. If the user only has single availability zone (in which case he indeed needs to remove the topologySpreadConstratint) we should at least keep the good practice and require the spread of replicas on different nodes.

@mkuratczyk mkuratczyk merged commit 3954794 into rabbitmq:main Jul 6, 2021
@mkuratczyk
Copy link
Contributor

Dzięki Jakub! ;)

@paapug paapug deleted the pod-anti-affinity branch July 6, 2021 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants