0

I want to write tests for HA k8s with multi-master setup.

I have read at this answer it is possible to allow user pods to be scheduled to a master node. I am bit hazy if it is ok to do this for multiple (or rather all) my masters.

I've read at k8s HA docs ...

For both methods you need this infrastructure:
Three machines that meet kubeadm’s minimum requirements for the masters
Three machines that meet kubeadm’s minimum requirements for the workers

Does this mean

  • minimum 3 hosts in total (i.e. sensible to run/test with each host as combined master and worker)?
  • minimum 6 hosts for testing, i.e. 3 x masters and 3 x workers ?
k1eran
  • 4,492
  • 8
  • 50
  • 73
  • You need 6 hosts at minimum: 3 masters and 3 workers. – aga Sep 13 '19 at 13:00
  • Hi abielak, Can you point me to a reference saying that? The answer from @p-ekambaram seems to say 3 hosts okay and each of those 3, can be a combined worker / master. – k1eran Sep 13 '19 at 15:42

2 Answers2

1

yes, you can schedule user work loads on masters. You need to taint the masters to allow workloads to be scheduled. user the below command to taint masters

kubectl taint nodes --all node-role.kubernetes.io/master-
P Ekambaram
  • 15,499
  • 7
  • 34
  • 59
0

Actually, you can do everything you want with the only one node cluster setup. It could be only one schedulable master and it could work under some kind of frontend http balancer. Your can make your test communicate with the APIserver via frontend HA, so, your test will be totally independent from the cluster nodes count in fact

Konstantin Vustin
  • 6,521
  • 2
  • 16
  • 32