3台服务器(centos 7)

1台master 10.211.55.6(A)

2台node  10.211.55.7 (B) 10.211.55.8(C)

以下A、B、C都要执行

1 安装epel-release源

# yum -y install epel-release

关闭防火墙服务和selinx

# systemctl stop firewalld

# systemctl disable firewalld

# setenforce 0

以下在master (A) 上执行

3 安装etcd和kubernetes-master

# yum -y install etcd kubernetes-master

编辑/etc/etcd/etcd.conf
5 编辑/etc/kubernetes/apiserver

6 启动etcd、kube-apiserver、kube-controller-manager、kube-scheduler服务,并设置开机启动。

# for SERVICES in etcd kube-apiserver kube-controller-manager kube-scheduler; do systemctl restart $SERVICES;systemctl enable $SERVICES;systemctl status $SERVICES ; done

测试master服务


7 在etcd中定义flannel网络

# etcdctl mk /atomic.io/network/config '{"Network":"172.17.0.0/16"}'

以下在node (B、C) 上执行

8 安装flannel和kubernetes-node

# yum -y install flannel kubernetes-node


9 修改/etc/sysconfig/flanneld

10 修改/etc/kubernetes/config

11 修改/etc/kubernetes/kubelet


12 在所有Node节点上启动kube-proxy,kubelet,docker,flanneld等服务,并设置开机启动。
# for SERVICES in kube-proxy kubelet docker flanneld;do systemctl restart $SERVICES;systemctl enable $SERVICES;systemctl status $SERVICES; done


以下在master (A) 上执行

13 验证集群是否安装成功

# kubectl get node



Logo

K8S/Kubernetes社区为您提供最前沿的新闻资讯和知识内容

更多推荐