Kubernetes建立Flannel Pod网络 [英] Kubernetes Setting Up Flannel Pod Network

查看:72
本文介绍了Kubernetes建立Flannel Pod网络的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在关注此指南说明如何设置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:

无法识别" https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml :获取 https://10.0.2.1:6443/api?timeout=32s :拨打tcp 10.0.2.1:6443:connect:连接被拒绝无法识别

unable to recognize "https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml": Get https://10.0.2.1:6443/api?timeout=32s: dial tcp 10.0.2.1:6443: connect: connection refused unable to recognize

这似乎意味着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网络的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆