问题描述
我正在关注此指南说明如何设置kubernetes集群.
I'm following this guide on how to set up a kubernetes swarm.
我的集群如下:
- 10.0.2.1:swarm1(管理员)
- 10.0.2.2:swarm2(工作者)(当前正在尝试设置单个节点swarm)
- 10.0.2.3:swarm2(工作者)(尚未配置)
我跟随它,直到输入命令的地方:
I followed it and got up to the part where I enter the command:
kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml
输入后,我会得到一个错误:
And once I enter that, I get an error:
这似乎意味着kubernetes主服务器运行不正常.如何启动服务器以使其可以连接?
Which seems to mean that the kubernetes master isn't running properly. How can I start the server so it can connect?
推荐答案
这是权限不足的错误.您没有运行此程序:
This is a not enough privilege error. Either you did not run this:
mkdir -p $ HOME/.kube须藤cp -i/etc/kubernetes/admin.conf $ HOME/.kube/config须藤chown $ {id -u):$ {id -g)$ HOME/.kube/config
或者以前的init中有一个admin.conf.在这种情况下,运行第二个命令并看到 cp:覆盖/home/aurelius/.kube/config'?
时,请确保键入 yes
并按Enter.
Or there is an admin.conf from previous inits. In this case while running second command and seeing cp: overwrite /home/aurelius/.kube/config'?
make sure you type yes
and press Enter.
这篇关于Kubernetes建立Flannel Pod网络的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!