概述
1、k8s网址https://github.com/kubernetes/
2、把master.zip上传到master节点上,解压源码包
3、把文件移动到k8s安装目录
# mv kube-controller-manager kube-scheduler kube-apiserver /opt/kubernetes/bin
4、增加执行权限
# chmod +x /opt/kubernetes/bin/*
5、执行apiserver.sh脚本
./apiserver.sh 192.168.1.20 master的ip地址 etcd节点地址(多个用,分割)
# ./apiserver.sh 192.168.1.20 https://192.168.1.20:2379,https://192.168.1.22:2379,https://192.168.1.23:2379
6、复制token到ssl下
# cp ssl/token.csv /opt/kubernetes/cfg/
7、启动apiserver
# systemctl start kube-apiserver
8、执行controller-manager.sh 参数:apiserver地址
# ./controller-manager.sh 127.0.0.1
9、执行./scheduler.sh 参数:apiserver地址
# ./scheduler.sh 127.0.0.1
10、查看是否正常,启动3个进程就是正常的etcd是原来的
# ps -ef | grep kub
root 838 1 3 20:13 ? 00:02:38 /opt/kubernetes/bin/etcd --name=etcd01 --data-dir=/var/lib/etcd/default.etcd --listen-peer-urls=https://192.168.1.20:2380 --listen-client-urls=https://192.168.1.20:2379,http://127.0.0.1:2379 --advertise-client-urls=https://192.168.1.20:2379 --initial-advertise-peer-urls=https://192.168.1.20:2380 --initial-cluster=etcd01=https://192.168.1.20:2380,etcd02=https://192.168.1.22:2380,etcd03=https://192.168.1.23:2380 --initial-cluster-token=etcd01=https://192.168.1.20:2380,etcd02=https://192.168.1.22:2380,etcd03=https://192.168.1.23:2380 --initial-cluster-state=new --cert-file=/opt/kubernetes/ssl/server.pem --key-file=/opt/kubernetes/ssl/server-key.pem --peer-cert-file=/opt/kubernetes/ssl/server.pem --peer-key-file=/opt/kubernetes/ssl/server-key.pem --trusted-ca-file=/opt/kubernetes/ssl/ca.pem --peer-trusted-ca-file=/opt/kubernetes/ssl/ca.pem
root 2149 1 6 21:33 ? 00:00:14 /opt/kubernetes/bin/kube-apiserver --logtostderr=true --v=4 --etcd-servers=https://192.168.1.20:2379,https://192.168.1.22:2379,https://192.168.1.23:2379 --insecure-bind-address=127.0.0.1 --bind-address=192.168.1.20 --insecure-port=8080 --secure-port=6443 --advertise-address=192.168.1.20 --allow-privileged=true --service-cluster-ip-range=10.10.10.0/24 --admission-control=NamespaceLifecycle,LimitRanger,SecurityContextDeny,ServiceAccount,ResourceQuota,NodeRestriction --authorization-mode=RBAC,Node --kubelet-https=true --enable-bootstrap-token-auth --token-auth-file=/opt/kuernetes/cfg/token.csv --service-node-port-range=30000-50000 --tls-cert-file=/opt/kubernetes/ssl/server.pem --tls-private-key-file=/opt/kubernetes/ssl/server-key.pem --client-ca-file=/opt/kubernetes/ssl/ca.pem --service-account-key-file=/opt/kubernetes/ssl/ca-key.pem --etcd-cafile=/opt/kubernetes/ssl/ca.pem --etcd-certfile=/opt/kubernetes/ssl/server.pem --etcd-keyfile=/opt/kubernetes/ssl/server-key.pem
root 2219 1 4 21:36 ? 00:00:04 /opt/kubernetes/bin/kube-controller-manager --logtostderr=true --v=4 --master=127.0.0.1:8080 --leader-elect=true --address=127.0.0.1 --service-cluster-ip-range=10.10.10.0/24 --cluster-name=kubernetes --cluster-signing-cert-file=/opt/kubernetes/ssl/ca.pem --cluster-signing-key-file=/opt/kubernetes/ssl/ca-key.pem --service-account-private-key-file=/opt/kubernetes/ssl/ca-key.pem --root-ca-file=/opt/kubernetes/ssl/ca.pem
root 2276 1 1 21:36 ? 00:00:01 /opt/kubernetes/bin/kube-scheduler --logtostderr=true --v=4 --master=127.0.0.1:8080 --leader-elect
root 2290 1504 0 21:37 pts/0 00:00:00 grep --color=auto kub
# echo "export PATH=$PATH:/opt/kubernetes/bin" >> /etc/profile
# source /etc/profile
11、写入环境变量
最后
以上就是飞快电话为你收集整理的K8S四:部署master节点的全部内容,希望文章能够帮你解决K8S四:部署master节点所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复