如何启动minikube?
我在ThinkPad X201i上的Linux机器Lubuntu 16.04上安装了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 $
我很惊讶,因为我没有创build任何服务开始。
如果它启动了,那么为什么没有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*
因为我的minikube
里没有图像,所以不能启动我的minikube
docker的docker员deamon:
$ 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').
我configuration了BIOS并启用了虚拟化,并启用了加速function:
$ 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?
为什么最后两个类似的命令给出了相反的信号呢?
更新:我input了rm -rf ~/.minikube/cache
命令,后面跟着minikube start --vm-driver kvm
命令几次,现在看来工作正常了:
$ 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
看看你的docker守护进程(docker ps)上运行的容器,kubernetes肯定在那里运行。
我从来没有在linux上testingminikube,所以我不确定,但是在windows上,它作为linux虚拟机中的容器运行。
问候,Thibault