0

i have a bare-metal kubernetes cluster with 1 master node and 4 worker nodes. I want to deploy my deployment objects on every 4 worker nodes but i can't. I try nodeSelector but looks like it only works on last key:value pair label.

Please help me.

1
  • If you do nothing Kubernetes will decide where to place the pods, and things will usually wind up distributed around the cluster. Do you want something more specific than a default scheduling policy; if so, what and why? Commented May 16, 2020 at 11:42

1 Answer 1

3

If you want to ensure that all nodes have that pod on them you can use a DaemonSet.

You can also use affinity/anti-affinity selectors.

Inter-pod affinity and anti-affinity allow you to constrain which nodes your pod is eligible to be scheduled based on labels on pods that are already running on the node rather than based on labels on nodes. The rules are of the form “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”

If you don't want to two instances are located on the same host, check following link

https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#never-co-located-in-the-same-node

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.