赞
踩
1. master安装和配置:
vim /etc/hosts
- 192.168.10.100 server11 master
- 192.168.10.101 node1
yum install -y etcd
vim /etc/etcd/etcd.conf #修改部分内容如下
- ETCD_LISTEN_CLIENT_URLS="http://0.0.0.0:2379"
-
- ETCD_ADVERTISE_CLIENT_URLS="http://server11:2379"
注:其中server11表示etcd服务器主机名
systemctl start etcd #启动etcd
systemctl enable etcd #开机自启etcd
etcdctl -C 192.168.10.100:2379 set /atomic.io/network/config '{"Network":"172.17.0.1/16"}'
yum install kubernetes-master
- vim /etc/kubernetes/apiserver
-
- KUBE_API_ADDRESS="--insecure-bind-address=0.0.0.0"
-
- KUBE_ETCD_SERVERS="--etcd-servers=http://server11:2379"
-
- KUBE_ADMISSION_CONTROL="--admission-control=NamespaceLifecycle,NamespaceExists,LimitRanger,ResourceQuota"
注:其中KUBE_ADMISSION_CONTROL的原有的SecurityContextDeny和ServiceAccount是权限相关的配置需要去掉。
vim /etc/kubernetes/config
KUBE_MASTER="--master=http://master:8080"
systemctl start kube-apiserver kube-scheduler kube-controller-manager
2. node1节点安装和配置
vim /etc/hosts
- 192.168.10.100 server11 master
- 192.168.10.101 node1
yum install -y docker flannel kubernetes-node
vim /etc/sysconfig/flanneld
- FLANNEL_ETCD_ENDPOINTS="http://server11:2379"
-
- FLANNEL_ETCD_PREFIX="/atomic.io/network"
vim /etc/kubernetes/config
- KUBELET_HOSTNAME="--hostname-override=node1"
-
- KUBELET_API_SERVER="--api-servers=http://master:8080"
systemctl start kubelet kube-proxy
3. 测试集群
在master节点运行
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。