Minikube使用go语言编写,单机版的kubernetes集群,安装Minikube折腾了2天,各种报错。
安装步骤:
1. 下载minikube并设定
#curl -Lo minikubehttps://storage.googleapis.com/minikube/releases/v0.7.0/minikube-linux-amd64&& chmod +x minikube && sudo mv minikube /usr/local/bin/
2. 确认minikube
# which minikube
/usr/local/bin/minikube
# minikube version
minikube version: v0.7.0
3. 下载kubectl并设定
我们还需要下载kubectl并设定
# curl -Lo kubectl http://storage.googleapis.com/kubernetes-release/release/v1.3.0/bin/linux/amd64/kubectl && chmod +x kubectl && sudo mv kubectl /usr/local/bin/
# which kubectl
/usr/local/bin/kubectl
# kubectl version
Client Version:version.Info{Major:"1", Minor:"3",GitVersion:"v1.3.0",GitCommit:"283137936a498aed572ee22af6774b6fb6e9fd94",GitTreeState:"clean", BuildDate:"2016-07-01T19:26:38Z",GoVersion:"go1.6.2", Compiler:"gc",Platform:"linux/amd64"}
Unable to connect to the server: dialtcp 192.168.99.100:8443: connect: network is unreachable
4. 安装Virtualbox
google官方是这样写的,Minikuberequires the latest Virtualbox to be installed on your system,所以还需要安装Virtualbox。在此处耽误了很久,
Virtualbox安装出现各种问题。
# cd /etc/yum.repos.d/
#wget http://download.virtualbox.org/virtualbox/rpm/rhel/virtualbox.repo
#yum update
#yum install binutils qt gcc make patch libgomp glibc-headers glibc-develkernel-headers kernel-devel dkms
#export KERN_DIR=/usr/src/kernels/3.10.0-514.26.2.el7.x86_64
注意此处根据具体情况3.10.0-514.26.2.el7.x86_64可能有所变化
注:网络上一般是使用# yum installVirtualBox-5.1安装VirtualBox,查看log,
log的确认:/var/log/vbox-install.log
发现出现错误如下:
VirtualBoxERROR: Kernel configuration is invalid."; Run 'make oldconfig && make prepare' on kernel src to fix it.
改用如下方式安装:
使用rpm安装virtualbox:
rpm-ivh VirtualBox-5.0-5.0.12_104815_el7-1.x86_64.rpm
如果出现错误,显示以下信息:
警告:VirtualBox-5.0-5.0.12_104815_el7-1.x86_64.rpm: 头V4 DSA/SHA1 Signature, 密钥 ID 98ab5139: NOKEY
错误:依赖检测失败:
libQtGui.so.4()(64bit) 被 VirtualBox-5.0-5.0.12_104815_el7-1.x86_64 需要
libQtOpenGL.so.4()(64bit) 被 VirtualBox-5.0-5.0.12_104815_el7-1.x86_64 需要
这是因为有两个依赖包没有安装,我们需要安装以下,使用在线安装,执行两条命令:
yuminstall qt
yuminstall qt-x11
出现错误,显示以下信息:
RecompilingVirtualBox kernel modules [失败]
(Look at /var/log/vbox-install.log to findout what went wrong)
ln:目标"setup" 不是目录
查看其中错误日志:
cat /var/log/vbox-install.log
Makefile:185:*** Error: unable to find the sources of your current Linux kernel. SpecifyKERN_DIR=
从网上获知,是某些依赖软件没有更新到最新,需要更新:
yumgroupinstall "Development Tools"
如果以前安装了VirtualBox5.1,会出现文件冲突,则yum –remove VirtualBox-5.1删除高版本即可。
vmware的设定方法:VM => “Settings…”=> Processors => 选中复选框Virtualize Intel VT-x/EPTor AMD-V/RVI
注意:只能在VM停下来的时候才能设定。