简体   繁体   English

Kubernetes建立Flannel Pod网络

[英]Kubernetes Setting Up Flannel Pod Network

I'm following this guide on how to set up a kubernetes swarm. 我正在遵循有关如何设置kubernetes集群的指南

My swarm will be as follows: 我的群将如下:

  • 10.0.2.1: swarm1 (master) 10.0.2.1:swarm1(master)
  • 10.0.2.2: swarm2 (worker) (currently trying to setup a single node swarm) 10.0.2.2:swarm2(工作者)(当前尝试设置单个节点swarm)
  • 10.0.2.3: swarm2 (worker) (not yet provisioned) 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: 一旦输入,就会出现错误:

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 无法识别“ 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:连接:拒绝连接无法识别

Which seems to mean that the kubernetes master isn't running properly. 这似乎意味着kubernetes主服务器运行不正常。 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 sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config sudo chown $(id -u):$(id -g) $HOME/.kube/config

Or there is an admin.conf from previous inits. 或以前的init中有一个admin.conf。 In this case while running second command and seeing cp: overwrite /home/aurelius/.kube/config'? 在这种情况下,运行第二个命令并看到cp: overwrite /home/aurelius/.kube/config'? make sure you type yes and press Enter. 确保输入yes ,然后按Enter。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM