我在我的Linux box Lubuntu16.04上的Thinkpad X201i上安装了minikube。
下面是我的完整安装步骤:
Download and install the minikube server
cd programs/install/bin
curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64;
chmod +x minikube;
Download and install the kubectl client
cd programs/install/bin
curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
chmod +x kubectl;
Install the libraries libvirt and qemu-kvm
sudo apt-get install libvirt-bin qemu-kvm
(NOTE: For Ubuntu 17.04 change the group to libvirt)
sudo usermod -a -G libvirtd $(whoami)
newgrp libvirtd
Install Docker Machine
cd /home/stephane/programs/install/bin
curl -L https://github.com/docker/machine/releases/download/v0.12.2/docker-machine-`uname -s`-`uname -m` > docker-machine;
chmod +x docker-machine
Install the KVM driver for Docker Machine
cd /home/stephane/programs/install/bin
curl -L https://github.com/dhiltgen/docker-machine-kvm/releases/download/v0.10.0/docker-machine-driver-kvm-ubuntu16.04 > docker-machine-driver-kvm;
chmod +x docker-machine-driver-kvm在系统重新启动时,群集似乎已启动:
$ kubectl cluster-info
Kubernetes master is running at http://localhost:8080
$ minikube ip
$我对此感到惊讶,因为我没有创建任何服务来启动它。
如果启动了,为什么没有IP?
我在/etc/init.d/目录中查找:
$ ll -t /etc/init.d/*virt*
-rwxr-xr-x 1 root 17K août 23 14:47 /etc/init.d/libvirt-guests*
-rwxr-xr-x 1 root 5,9K août 11 07:50 /etc/init.d/libvirt-bin*
-rwxr-xr-x 1 root 4,0K août 11 07:50 /etc/init.d/virtlockd*
-rwxr-xr-x 1 root 3,9K août 11 07:50 /etc/init.d/virtlogd*
$ ll -t /etc/init.d/docker
-rwxr-xr-x 1 root 3,8K mai 4 23:36 /etc/init.d/docker*不能是docker守护进程启动我的minikube,因为我的docker中没有图像:
$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES一开始,我在考虑手动启动它。
但当我这样做时,它显示尝试启动,但失败了,因为它查找了一个不存在的图像:
$ minikube start --vm-driver kvm
Starting local Kubernetes v1.7.5 cluster...
Starting VM...
E0912 18:23:37.989448 24423 start.go:143] Error starting host: Error starting stopped host: virError(Code=38, Domain=18, Message='Cannot access storage file '/root/.minikube/machines/minikube/boot2docker.iso' (as uid:64055, gid:129): Aucun fichier ou dossier de ce type').我配置了BIOS并启用了虚拟化,但我确实启用了加速:
$ sudo /usr/sbin/kvm-ok
INFO: /dev/kvm exists
KVM acceleration can be used我承认我将这些库安装在了一个非标准的目录位置:/home/stephane/programs/install/bin
不同命令的一些输出:
$ egrep -c '(vmx|svm)' /proc/cpuinfo
4
$ virsh list --all
ID Nom État
----------------------------------------------------它仍然说它正在运行:
$ kubectl cluster-info
Kubernetes master is running at http://localhost:8080虽然它不能连接:
$ kubectl cluster-info dump
The connection to the server localhost:8080 was refused - did you specify the right host or port?为什么最后两个命令是相似的,却给出了相反的信号?
更新:我在minikube start --vm-driver kvm命令之后输入了几次rm -rf ~/.minikube/cache命令,今天它似乎起作用了:
$ minikube start --vm-driver kvm
Starting local Kubernetes v1.7.5 cluster...
Starting VM...
Downloading Minikube ISO
106.36 MB / 106.36 MB [============================================] 100.00% 0s
Getting VM IP address...
Moving files into cluster...
Setting up certs...
Connecting to cluster...
Setting up kubeconfig...
Starting cluster components...
Kubectl is now configured to use the cluster.
$ minikube ip
192.168.42.196发布于 2017-09-12 02:08:59
看看您的docker守护进程(docker ps)上运行的容器,kubernetes肯定在那里运行。
我从来没有在linux上测试过minikube,所以我不确定,但在windows上,它是作为linux虚拟机中的容器运行的。
致敬,Thibault
https://stackoverflow.com/questions/46141643
复制相似问题