From b9add7afed18070513dd570728b58f3bf35e3faf Mon Sep 17 00:00:00 2001 From: Jimmy Song Date: Wed, 17 May 2017 17:18:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=AD=A5=E9=AA=A4=E9=A1=BA?= =?UTF-8?q?=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 06-部署node节点.md | 52 +++++++++++++++++++++--------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/06-部署node节点.md b/06-部署node节点.md index 9aff37bb2..c316176b2 100644 --- a/06-部署node节点.md +++ b/06-部署node节点.md @@ -130,31 +130,6 @@ DOCKER_OPT_IPMASQ="--ip-masq=true" DOCKER_OPT_MTU="--mtu=1450" ``` -现在查询etcd中的内容可以看到: - -``` -$etcdctl --endpoints=${ETCD_ENDPOINTS} \ - --ca-file=/etc/kubernetes/ssl/ca.pem \ - --cert-file=/etc/kubernetes/ssl/kubernetes.pem \ - --key-file=/etc/kubernetes/ssl/kubernetes-key.pem \ - ls /kube-centos/network/subnets -/kube-centos/network/subnets/172.30.14.0-24 -/kube-centos/network/subnets/172.30.38.0-24 -/kube-centos/network/subnets/172.30.46.0-24 -$etcdctl --endpoints=${ETCD_ENDPOINTS} \ - --ca-file=/etc/kubernetes/ssl/ca.pem \ - --cert-file=/etc/kubernetes/ssl/kubernetes.pem \ - --key-file=/etc/kubernetes/ssl/kubernetes-key.pem \ - get /kube-centos/network/config -{ "Network": "172.30.0.0/16", "SubnetLen": 24, "Backend": { "Type": "vxlan" } } -$etcdctl get /kube-centos/network/subnets/172.30.14.0-24 -{"PublicIP":"172.20.0.114","BackendType":"vxlan","BackendData":{"VtepMAC":"56:27:7d:1c:08:22"}} -$etcdctl get /kube-centos/network/subnets/172.30.38.0-24 -{"PublicIP":"172.20.0.115","BackendType":"vxlan","BackendData":{"VtepMAC":"12:82:83:59:cf:b8"}} -$etcdctl get /kube-centos/network/subnets/172.30.46.0-24 -{"PublicIP":"172.20.0.113","BackendType":"vxlan","BackendData":{"VtepMAC":"e6:b2:fd:f6:66:96"}} -``` - **设置docker0网桥的IP地址** ```shell @@ -175,7 +150,7 @@ ifconfig docker0 $FLANNEL_SUBNET valid_lft forever preferred_lft forever ``` -现在就可以重启docker了。 +**启动docker** 重启了docker后还要重启kubelet,这时又遇到问题,kubelet启动失败。报错: @@ -197,6 +172,31 @@ systemctl start flanneld systemctl status flanneld ``` +现在查询etcd中的内容可以看到: + +```bash +$etcdctl --endpoints=${ETCD_ENDPOINTS} \ + --ca-file=/etc/kubernetes/ssl/ca.pem \ + --cert-file=/etc/kubernetes/ssl/kubernetes.pem \ + --key-file=/etc/kubernetes/ssl/kubernetes-key.pem \ + ls /kube-centos/network/subnets +/kube-centos/network/subnets/172.30.14.0-24 +/kube-centos/network/subnets/172.30.38.0-24 +/kube-centos/network/subnets/172.30.46.0-24 +$etcdctl --endpoints=${ETCD_ENDPOINTS} \ + --ca-file=/etc/kubernetes/ssl/ca.pem \ + --cert-file=/etc/kubernetes/ssl/kubernetes.pem \ + --key-file=/etc/kubernetes/ssl/kubernetes-key.pem \ + get /kube-centos/network/config +{ "Network": "172.30.0.0/16", "SubnetLen": 24, "Backend": { "Type": "vxlan" } } +$etcdctl get /kube-centos/network/subnets/172.30.14.0-24 +{"PublicIP":"172.20.0.114","BackendType":"vxlan","BackendData":{"VtepMAC":"56:27:7d:1c:08:22"}} +$etcdctl get /kube-centos/network/subnets/172.30.38.0-24 +{"PublicIP":"172.20.0.115","BackendType":"vxlan","BackendData":{"VtepMAC":"12:82:83:59:cf:b8"}} +$etcdctl get /kube-centos/network/subnets/172.30.46.0-24 +{"PublicIP":"172.20.0.113","BackendType":"vxlan","BackendData":{"VtepMAC":"e6:b2:fd:f6:66:96"}} +``` + ## 安装和配置 kubelet kubelet 启动时向 kube-apiserver 发送 TLS bootstrapping 请求,需要先将 bootstrap token 文件中的 kubelet-bootstrap 用户赋予 system:node-bootstrapper cluster 角色(role),