Kubernetes Master Deployment Scheduler and HA Deployment (5)

Source: Internet
Author: User
Tags etcd k8s

The role of Kubernetes Scheduler is to bind controller manager to a new pod according to a specific scheduling algorithm and scheduling policy to a suitable node in the cluster, and to write the binding information to the ETCD.

I. Deployment OF Scheduler

The following generates the Kube-scheduler Kubeconfig file, as follows:

cd/etc/kubernetesexport kube_apiserver="https://192.168.15.200:6443"

Configure cluster

Kubectl config set---certificate-authority=/etc/kubernetes/ssl/--embed-certs=true  --server=--kubeconfig=scheduler.conf

Configure credentials

Kubectl config set-credentials system:kube---client-certificate=/etc/kubernetes/ssl/-- Embed-certs=true--client-key=/etc/kubernetes/ssl/scheduler---kubeconfig= Scheduler.conf

Configure context

Kubectl config set-context system:kube---cluster=--user=system:kube---kubeconfig= Scheduler.conf

Configure default context

Kubectl config use-context system:[email protected]--kubeconfig=scheduler.conf

Distribute the generated scheduler.conf file to the/etc/kubernetes directory of each Master node, as follows:

SCP scheduler.conf k8s-master02:/etc/kubernetes/                                      SCP scheduler.conf k8s-master03:/etc/ kubernetes/

Create the Kube-scheduler systemd service startup file as follows:

Export kube_apiserver="https://192.168.15.200:6443"Cat>/usr/lib/systemd/system/kube-scheduler.service <<eof[unit]description=kube-Schedulerafter=Network.targetafter=kube-Apiserver.service [Service]environmentfile=-/etc/kubernetes/Schedulerexecstart=/usr/local/bin/kube-Scheduler--logtostderr=true         --v=0         --master=${kube_apiserver}--kubeconfig=/etc/kubernetes/scheduler.conf--leader-elect=trueRestart=on-Failuretype=Simplelimitnofile=65536[Install]wantedby=multi-user.targeteof

Distribute to other hosts:

SCP /usr/lib/systemd/system/kube-scheduler.service k8s-master02:/usr/lib/systemd/system/                                          SCP /usr/lib/systemd/system/kube-scheduler.service k8s-master03:/usr/lib/systemd/system/

Start the service on each node:

Systemctl daemon-reloadsystemctl enable Kube-schedulersystemctl start kube-Schedulersystemctl Status Kube-scheduler

The Kube-schedule deployment on three Master nodes is completed by electing a leader job.

Review the status of each core component of the Kubernetes Master cluster as follows:

[[Email protected]Master01 kubernetes]# kubectl get csname STATUS MESSAGE Erroretcd-1Healthy {" Health":"true"} Scheduler Healthy OK Controller - manager Healthy OK etcd-0Healthy {" Health":"true"} ETCD-2Healthy {" Health":"true"}

Kubernetes Master Deployment Scheduler and HA Deployment (5)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.