简体   繁体   中英

setting up deployment on multi-node kubernetes

I'm just starting to explore Kubernetes, and there is one thing I find unclear. Suppose I have a master node that I have set up with kubeadm , and another two worker nodes that I had joined to master. Now I have a yaml file that specifies the details of a Deployment and I need to run:

kubectl create -f dep.yaml

Do I need to run this command on master only? and then the master may or may not decide to use both worker nodes for the deployment according to optimal load distribution? Or do I need to run this in all worker nodes?

You don't have to. You just need to run this command once and kube-scheduler will schedule it in appropriate node.

Look at the diagram of this page: Concepts Underlying the Cloud Controller Manager

Mster Nodes runs, kube-apiserver , etcd , kube-scheduler , kube-controller-manager and cloud-controller-manager .

kube-scheduler watches for newly created pod and schedule it to appropriate node based on resource requirements, hardware/software/policy constraints, affinity and anti-affinity etc.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM