不能在stream浪汉上安装Kubernetes

使用本指南在Vagrant群集上安装Kubernetes:

https://kubernetes.io/docs/getting-started-guides/kubeadm/

(2/4) Initializing your master ,出现了一些错误:

 [root@localhost ~]# kubeadm init [kubeadm] WARNING: kubeadm is in beta, please do not use it for production clusters. [init] Using Kubernetes version: v1.6.4 [init] Using Authorization mode: RBAC [preflight] Running pre-flight checks [preflight] Some fatal errors occurred: /proc/sys/net/bridge/bridge-nf-call-iptables contents are not set to 1 [preflight] If you know what you are doing, you can skip pre-flight checks with `--skip-preflight-checks` 

我检查了/proc/sys/net/bridge/bridge-nf-call-iptables文件的内容,其中只有一个0

(3/4) Installing a pod network ,我下载了kube-flannel文件:

https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml

运行kubectl apply -f kube-flannel.yml ,出错:

 [root@localhost ~]# kubectl apply -f kube-flannel.yml The connection to the server localhost:8080 was refused - did you specify the right host or port? 

在这之前,我不知道该怎么做。

我的Vagrantfile

  # Master Server config.vm.define "master", primary: true do |master| master.vm.network :private_network, ip: "192.168.33.200" master.vm.network :forwarded_port, guest: 22, host: 1234, id: 'ssh' end 

为了通过编辑/etc/sysctl.conf来设置/proc/sys/net/bridge/bridge-nf-call-iptables 。 在那里你可以添加[1]

 net.bridge.bridge-nf-call-iptables = 1 

然后执行

 sudo sysctl -p 

这些变化将被应用。 有了这个前飞行检查应该通过。


[1] http://wiki.libvirt.org/page/Net.bridge.bridge-nf-call_and_sysctl.conf