使用本指南在 Vagrant 集群上安装 Kubernetes:
https://kubernetes.io/docs/getting-started-guides/kubeadm/ https://kubernetes.io/docs/getting-started-guides/kubeadm/
At (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
in it.
At (3/4) Installing a pod network
, 我下载了kube-flannel
file:
https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml
And run 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?
直到这里,我还不知道如何继续。
My 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