joakimhew/locust-kubernetes

Why specify podAffinity for slaves?

Closed this issue · 1 comments

Hey there,

I'm pretty new to Kube and I'm using your charts as a jumping-off point to build my own. I was wondering why you've got the slaves specifying a podAffinity to the master with topologyKey: "kubernetes.io/hostname"? If my understanding of that is correct this ensures that all slaves are scheduled onto the same host as the master. This seems like a major oversight: It's not a distributed system if everything is running on a single host. And if you've got a 4-core host but you're running 10 slaves then all 10 slaves are sharing those 4 cores.

Thanks for sharing this, it's helped me get up and running quickly :)

@JDiPierro Thank you for your kind comment 😃I'm sorry about the late answer!

You are right, this was a temporarily fix to make sure the master was running before slaves were scheduled. There was an issue where slaves would not register properly if they started before the master and this was a "hack" to make control the order of deployment.

I'll update the template to get rid of the podAffinity!
Thanks!