0

I have a StatefulSet with several replicas, for example 3 and multiple kubernetes Node in two zones.

I want to place the FIRST replica in the selected zone and the rest in the others zones.

  • mysts-0-0 < main_zone
  • mysts-0-1 < back_zone
  • mysts-0-2 < back_zone

Why the first one? Each pod is a database instance. Replication is configured between them. And by default the first node is master.

So I want to be able to influence where the first node is installed.

jesmart
  • 87
  • 2
  • 10

1 Answers1

1

This is not supported in StatefulSet, as the Pod-template is identical for each replica.

You might be able to achieve this by writing a custom scheduler. For inspiration, see this article for a custom scheduler for CockroachDB: A Custom Kubernetes Scheduler to Orchestrate Highly Available Applications

Jonas
  • 121,568
  • 97
  • 310
  • 388