一步步安装部署kubernetes集群(三)3.4
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
相关推荐
朱培知浅ZLH 2020-11-16
cdbdqn00 2020-11-12
达观数据 2020-11-11
JustinChia 2020-11-11
远远的山 2020-11-09
jingtao 2020-11-08
大叔比较胖 2020-10-30
gracecxj 2020-10-30
onepiecedn 2020-10-29
kunyus 2020-10-28
JustHaveTry 2020-10-27
锋锋 2020-10-26
hubanbei00的家园 2020-10-25
谢恩铭 2020-10-23
btqszl 2020-10-21
kaidiphp 2020-10-13
guchengxinfen 2020-10-12
liverlife 2020-10-10
BigDataMining 2020-10-08