声明:接博客kubeadm安装kubernetes(flannel)
环境等都是一样,只是换了CNI而已,相关环境请参考kubeadm安装kubernetes(flannel)
未成功,估计是官方镜像存在bug,有兴趣的可以一起研究学习
请自行下载weave-daemonset-k8s-1.6.yaml
weave.yaml
[root@master kubernetes]# kubectl create -f weave.yaml
serviceaccount "weave-net" created
clusterrole "weave-net" created
clusterrolebinding "weave-net" created
daemonset "weave-net" created
docker.io/weaveworks/weave-npc 2.0.0 fa9a5a16a934 29 hours ago 54.68 MB
docker.io/weaveworks/weave-kube 2.0.0 61fea1129ec7 29 hours ago 100.6 MB
[root@master kubernetes]# kubectl get pods -n kube-system
NAME READY STATUS RESTARTS AGE
etcd-master 1/1 Running 0 6h
kube-apiserver-master 1/1 Running 0 6h
kube-controller-manager-master 1/1 Running 0 6h
kube-dns-692378583-1h70j 3/3 Running 3 6h
kube-proxy-2gzvq 1/1 Running 0 5h
kube-proxy-31lrc 1/1 Running 0 5h
kube-proxy-3rk7z 1/1 Running 0 6h
kube-scheduler-master 1/1 Running 0 6h
weave-net-8lwqj 2/2 Running 0 11m
weave-net-d9whj 2/2 Running 0 11m
weave-net-pq1m1 2/2 Running 0 11m
[root@master kubernetes]# kubectl get nodes
NAME STATUS AGE VERSION
master Ready 6h v1.6.6
slave Ready 5h v1.6.6
slave1 Ready 5h v1.6.6
[root@slave ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
docker.io/weaveworks/weave-npc 2.0.0 fa9a5a16a934 29 hours ago 54.68 MB
docker.io/weaveworks/weave-kube 2.0.0 61fea1129ec7 29 hours ago 100.6 MB
gcr.io/google_containers/kube-proxy-amd64 v1.6.6 b01133efa4f0 7 days ago 109 MB
gcr.io/google_containers/pause-amd64 3.0 99e59f495ffa 13 months ago 746.9 kB
[root@master kubernetes]# kubectl create -f dashboard.yaml
serviceaccount "kubernetes-dashboard" created
clusterrolebinding "kubernetes-dashboard" created
deployment "kubernetes-dashboard" created
service "kubernetes-dashboard" created
kubectl describe pod kubernetes-dashboard-2039414953-vk82s -n kube-system
...
3m 3m 1 default-scheduler Normal Scheduled Successfully assigned kubernetes-dashboard-2039414953-vk82s to slave
6m 3m 15 kubelet, slave Normal SandboxChanged Pod sandbox changed, it will be killed and re-created.
6m 3m 15 kubelet, slave Warning FailedSync Error syncing pod, skipping: failed to "KillPodSandbox" for "80a6e83b-58f9-11e7-9007-080027024b3f" with KillPodSandboxError: "rpc error: code = 2 desc = NetworkPlugin cni failed to teardown pod \"kubernetes-dashboard-2039414953-vk82s_kube-system\" network: connection is unauthorized"
[root@master kubernetes]# kubectl get pods -n kube-system
NAME READY STATUS RESTARTS AGE
etcd-master 1/1 Running 0 6h
kube-apiserver-master 1/1 Running 0 6h
kube-controller-manager-master 1/1 Running 0 6h
kube-dns-692378583-1h70j 3/3 Running 3 6h
kube-proxy-2gzvq 1/1 Running 0 5h
kube-proxy-31lrc 1/1 Running 0 5h
kube-proxy-3rk7z 1/1 Running 0 6h
kube-scheduler-master 1/1 Running 0 6h
kubernetes-dashboard-2039414953-vk82s 0/1 ContainerCreating 0 5m
weave-net-8lwqj 2/2 Running 0 20m
weave-net-d9whj 2/2 Running 0 20m
weave-net-pq1m1 2/2 Running 0 20m
出现错误,weave CNI存在 bug,由于时间的关系,以后再跟踪修复
network: connection is unauthorized