码迷,mamicode.com
首页 > Web开发 > 详细

一步步安装部署kubernetes集群(三)3.4

时间:2020-05-15 13:20:52      阅读:59      评论:0      收藏:0      [点我收藏+]

标签:nal   viso   update   enabled   des   etcd   redirect   tar   range   

3.4 部署controller-manager

3.4.1 集群规划

主机名 角色 IP地址
pg60-21.k8s.host.com controller-manager 10.20.60.21
pg60-22.k8s.host.com controller-manager 10.20.60.22
pg60-23.k8s.host.com controller-manager 10.20.60.23

3.4.2 创建启动脚本

pg60-21.k8s.host.com 虚机实例上操作,另外一台运算节点安装部署方法类似。

shell> cat /opt/kubernetes/server/sbin/kube-controller-manager.sh 
#!/bin/sh
/opt/kubernetes/server/bin/kube-controller-manager   --cluster-cidr 172.60.0.0/16   --leader-elect true   --log-dir /export/kubernetes/logs/kube-controller-manager   --master http://127.0.0.1:8080   --service-account-private-key-file /opt/kubernetes/server/ssl/ca-key.pem   --service-cluster-ip-range 192.168.0.0/16   --root-ca-file /opt/kubernetes/server/ssl/ca.pem   --v 2

shell> chmod +x /opt/kubernetes/server/sbin/kube-controller-manager.sh
shell> mkdir -p /export/kubernetes/logs/kube-controller-manager

3.4.3 在supervisor中创建kube-controller-manager.conf的配置

shell> cat > /opt/supervisor/conf.d/kube-controller-manager.conf << EOF
[program:kube-controller-manager-60-21]
command=/opt/kubernetes/server/sbin/kube-controller-manager.sh
numprocs=1
directory=/opt/kubernetes/server/bin
autostart=true
autorestart=true
startsecs=22
startretries=3
exitcodes=0,2
stopsignal=QUIT
stopwaitsecs=10
user=root
redirect_stderr=false
stdout_logfile=/export/kubernetes/logs/kube-controller-manager/controll.stdout.log
stdout_logfile_maxbytes=64MB
stdout_logfile_backups=4
stdout_capture_maxbytes=1MB
stdout_events_enabled=false
stderr_logfile=/export/kubernetes/logs/kube-controller-manager/controll.stderr.log
stderr_logfile_maxbytes=64MB
stderr_logfile_backups=4
stderr_capture_maxbytes=1MB
stderr_events_enabled=false
EOF

3.4.4 启动kube-controller-manager服务并检查

shell> supervisorctl update
kube-controller-manager-60-21: added process group
shell> supervisorctl status
etcd-server-60-21 RUNNING pid 1755, uptime 0:04:39
kube-apiserver-60-21 RUNNING pid 1756, uptime 0:04:39
kube-controller-manager-60-21 RUNNING pid 1832, uptime 0:00:25

一步步安装部署kubernetes集群(三)3.4

标签:nal   viso   update   enabled   des   etcd   redirect   tar   range   

原文地址:https://www.cnblogs.com/91donkey/p/12894198.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!