Đinh Anh Huy
Đinh Anh Huy

Reputation: 545

K8s How to deploy pod 1 per specific node, not all node in cluster

Let say I have a cluster with 10 worker nodes and the application is randomly deployed to them. I have a namespace X, have 20 instances of nodejs that want to connect to MySQL Group Replication via MySQL Router.
I want to deploy 1 instance of MySQL Router to every node that has at least 1 of my nodejs application. Is this logic support with the k8s default rule?
Ex:

enter image description here

Upvotes: 0

Views: 430

Answers (1)

Đinh Anh Huy
Đinh Anh Huy

Reputation: 545

Using Inter-pod affinity:

this pod should (or, in the case of anti-affinity, should not) run in an X if that X is already running one or more pods that meet rule Y.

Upvotes: 1

Related Questions