0

Statefulsets running in K8s cluster as below:

Node 1: app-0 Node 2: app-1 Node 3: app-2

When new node added to cluster, how to ensure new pod (app-4) will be spawned in the new node ?

Deploying using helm(not using operator)

Rajen Patel
  • 49
  • 1
  • 9
  • How do you make sure one sts pod run on one node ? Two sts pods can run in same node know. – Dinesh Balasubramanian May 21 '20 at 06:56
  • If a new node is added, do you always want a new pod to be launched there (and if so, why)? Or are you just trying to put the pods on different nodes (and if so, why)? – David Maze May 21 '20 at 10:34
  • Please: 1- Fix your title, there is some mixing words confusing it. 2 - Are you using a public helm chart? Or are you creating a helm chart? 3- You can read this guide [How to deploy a Statefulset where you get one pod per node (like a Daemonset) StatefulDaemonSet](https://medium.com/@johnjjung/building-a-kubernetes-daemonstatefulset-30ad0592d8cb) to get a better idea. Provide more practical info otherwise the advices will be very general. – Will R.O.F. May 21 '20 at 13:28
  • @DineshBalasubramanian Using Node Anti affinity – Rajen Patel May 22 '20 at 19:00
  • @david Yes I have requirement that when sts pod should launch when new node added. – Rajen Patel May 22 '20 at 19:01
  • @RajenPatel Can you share the use case at high level ? And also why it is not possible to use Daemonset for this ? – Dinesh Balasubramanian May 23 '20 at 04:08

1 Answers1

0

I would suggest using a combination of Node Affinity & Horizontal Pod Autoscaler for this use-case.

hdhruna
  • 865
  • 6
  • 15