二進制安裝kubernetes(四) kube-scheduler組件安裝

介紹資料轉載地址:https://www.jianshu.com/p/c4c60ccda8d0

kube-scheduler在集羣中的做用

kube-scheduler是以插件形式存在的組件,正由於以插件形式存在,因此其具備可擴展可定製的特性。kube-scheduler至關於整個集羣的調度決策者,其經過預選和優選兩個過程決定容器的最佳調度位置。ui

kube-scheduler源碼中的關鍵性調用鏈

 

 

 

kube- scheduler部署在hdss7-21,22上:
建立啓動腳本:
# vi /opt/kubernetes/server/bin/kube-scheduler.sh
#!/bin/sh
./kube-scheduler \
  --leader-elect  \
  --log-dir /data/logs/kubernetes/kube-scheduler \
  --master http://127.0.0.1:8080 \
  --v 2

執行權限:this

# chmod +x /opt/kubernetes/server/bin/kube-scheduler.sh

建立日誌存儲目錄:spa

# mkdir -p /data/logs/kubernetes/kube-scheduler

編輯supervisord腳本:紅色部分第二臺須要修改pwa

 # vi /etc/supervisord.d/kube-scheduler.ini
[program:kube-scheduler-7-21]
command=/opt/kubernetes/server/bin/kube-scheduler.sh                     ; the program (relative uses PATH, can take args)
numprocs=1                                                               ; number of processes copies to start (def 1)
directory=/opt/kubernetes/server/bin                                     ; directory to cwd to before exec (def no cwd)
autostart=true                                                           ; start at supervisord start (default: true)
autorestart=true                                                         ; retstart at unexpected quit (default: true)
startsecs=30                                                             ; number of secs prog must stay running (def. 1)
startretries=3                                                           ; max # of serial start failures (default 3)
exitcodes=0,2                                                            ; 'expected' exit codes for process (default 0,2)
stopsignal=QUIT                                                          ; signal used to kill process (default TERM)
stopwaitsecs=10                                                          ; max num secs to wait b4 SIGKILL (default 10)
user=root                                                                ; setuid to this UNIX account to run the program
redirect_stderr=true                                                     ; redirect proc stderr to stdout (default false)
stdout_logfile=/data/logs/kubernetes/kube-scheduler/scheduler.stdout.log ; stderr log path, NONE for none; default AUTO
stdout_logfile_maxbytes=64MB                                             ; max # logfile bytes b4 rotation (default 50MB)
stdout_logfile_backups=4                                                 ; # of stdout logfile backups (default 10)
stdout_capture_maxbytes=1MB                                              ; number of bytes in 'capturemode' (default 0)
stdout_events_enabled=false                                              ; emit events on stdout writes (default false)

更新supervisord:插件

# supervisorctl update
# supervisorctl status

 

 檢查一下狀態:rest

# ln -s /opt/kubernetes/server/bin/kubectl /usr/bin/kubectl
# kubectl get cs

 

 

至此kube-scheduler已經安裝完成,接下來安裝kubelet。日誌

相關文章
相關標籤/搜索