部署环境


IP地址 主机名 功能
10.1.104.200 k8s-deploy 部署节点,不承担实际作用
10.1.104.201 k8s-master01 master节点
10.1.104.202 k8s-master02 master节点
10.1.104.203 k8s-master03 master节点
10.1.104.204 k8s-nginx 负载均衡节点,实际生产中应为HA架构
10.1.104.205 k8s-node01 node节点
10.1.104.206 k8s-node02 node节点
10.1.104.207 k8s-node03 node节点

分发各节点的二进制文件


下载kubernetes二进制文件并分发到各节点(k8s-deploy):

下载kubernetes二进制文件并解压:

cd /opt/k8s/work
wget http://download.wenjun1984.cn/Kubernetes/Kubernetes/1.14/kubernetes-server-linux-amd64.tar.gz
tar -xzvf kubernetes-server-linux-amd64.tar.gz

cd kubernetes
tar -xzvf kubernetes-src.tar.gz

分发kubernetes二进制文件到各节点:

cd /opt/k8s/work
source /opt/k8s/bin/environment.sh

for node_ip in ${NODE_IPS[@]}
    do
        echo ">>> ${node_ip}"
        scp kubernetes/server/bin/{apiextensions-apiserver,cloud-controller-manager,kube-apiserver,kube-controller-manager,kube-proxy,kube-scheduler,kubeadm,kubectl,kubelet,mounter} root@${node_ip}:/opt/k8s/bin/
        ssh root@${node_ip} "chmod +x /opt/k8s/bin/*"
    done
文档更新时间: 2020-10-22 15:55   作者:闻骏