Stephen
Stephen

Reputation: 21

Is there a way to ensure that an instance of a pod runs on every minion in a cluster?

If you know the number of minions ahead of time, I suppose you could create x number of replicas, provided that you give a host port to ensure that there is one replica per minion, but is there a way to say that a pod should run on every minion if you don't know the number of minions ahead of time (or if minions are added later)?

Upvotes: 2

Views: 1230

Answers (1)

Alex Robinson
Alex Robinson

Reputation: 13377

There's been a lot of talk within the project about creating a more straightforward feature to do this (and how to work around it in the meantime), but nothing official has been added yet, so these are really the two best options at the moment:

  1. You can put files containing the "manifest" section of your pod's config into each node's /etc/kubernetes/manifests directory. The kubelet on the machine will detect it and run it.
  2. You can use a host port and set the number of replicas to a number larger than the number of minions. It won't hurt the cluster to have a few too many replicas, as they won't be able to run anywhere until more nodes are added.

Upvotes: 3

Related Questions