如何启动minikube? [英] How to start minikube?

查看:488
本文介绍了如何启动minikube?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Thinkpad X201i的Linux机器上的Lubuntu 16.04上安装了minikube.

I installed minikube on my Linux box Lubuntu 16.04 on a Thinkpad X201i.

这是我完整的安装步骤:

Here are my complete install steps:

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

在系统重新启动时,群集似乎已启动:

On system reboot, the cluster seems to be started:

$ kubectl cluster-info
Kubernetes master is running at http://localhost:8080
$ minikube ip
$

对此我感到很惊讶,因为我没有为其启动创建任何服务.

I'm surprised about that, since I did not create any service for it to start.

如果启动了,那为什么没有IP?

And if it is started, then why is there no 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的docker守护进程,因为我的docker中没有映像:

It can't be the docker deamon that starts my minikube as there are no image in my docker:

$ docker ps -a
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES

起初,我正在考虑手动启动它.

At first, I was thinking of manually starting it.

但是,当我这样做时,它表示尝试启动,但是由于查找不存在的图像而失败:

But when I do so, it shows an attempt to start, but fails as it looks up an image that does not exist:

$ 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并启用了虚拟化,并且确实启用了加速功能

I configured the BIOS and enabled the Virtualization and I do have accelaration enabled:

$ sudo /usr/sbin/kvm-ok
INFO: /dev/kvm exists
KVM acceleration can be used

我承认我将库安装在非标准目录位置: /home/stephane/programs/install/bin

I admit I installed the libraries in a non standard directory location: /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?

为什么最后两个类似的命令给出相反的信号?

Why are these last two similar commands, giving such opposite signal ?

更新:我在rm -rf ~/.minikube/cache命令中键入了几次,然后在minikube start --vm-driver kvm命令中键入了几次,今天看来可以使用了:

UPDATE: I typed in the rm -rf ~/.minikube/cache command followed by the minikube start --vm-driver kvm command a few times, and today it seemed to work:

$ 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肯定在那里运行.

Have a look to the containers running on your docker daemon (docker ps), kubernetes is certainly running there.

我从未在Linux上测试过minikube,所以不确定,但是在Windows上,它作为Linux vm中的容器运行.

I never tested minikube on linux so I'm not sure, but on windows, it runs as containers inside a linux vm.

关于, 锡伯特

这篇关于如何启动minikube?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆