无法在Vagrant上安装Kubernetes [英] Can't install Kubernetes on Vagrant
问题描述
使用本指南在Vagrant集群上安装Kubernetes:
Use this guide to install Kubernetes on Vagrant cluster:
https://kubernetes.io/docs/getting-started-guides/kubeadm/
在(2/4)初始化您的母版
,出现一些错误:
[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
。
I checked the /proc/sys/net/bridge/bridge-nf-call-iptables
file content, there is only one 0
in it.
在(3/4)安装Pod网络
时,我下载了 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?
直到这里,我都不知道该怎么做。
Until here, I don't know how to goon.
我的 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
推荐答案
为了设置 / proc / sys / net / bridge / bridge-nf-call-iptables
,方法是编辑 /etc/sysctl.conf
。在那里,您可以添加[1]
In order to set /proc/sys/net/bridge/bridge-nf-call-iptables
by editing /etc/sysctl.conf
. There you can add [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
这篇关于无法在Vagrant上安装Kubernetes的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!