如何通过 Minikube 在本地安装 Kubernetes

Pab*_*chi 5 virtualization kubernetes 18.04

为了了解更多关于 Kubernetes 的信息,我尝试安装一个独立的实例。如果你尝试运行minikube终端?建议通过 snap 安装它

sudo snap install minikube kubectl
Run Code Online (Sandbox Code Playgroud)
  • snap info minikube

    Minikube 是一个可以轻松在本地运行 Kubernetes 的工具。Minikube 在您笔记本电脑上的虚拟机内运行一个单节点 Kubernetes 集群,供想要试用 Kubernetes 或使用它进行日常开发的用户使用。

  • snap info kubectl

    kubectl 是一个命令行界面,用于针对 Kubernetes 运行命令

但这让我犯了这个错误:

$ minikube start
There is a newer version of minikube available (v0.32.0).  Download it here:
https://github.com/kubernetes/minikube/releases/tag/v0.32.0
To disable this notification, add WantUpdateNotification: False to the json config file at /home/pablo/snap/minikube/4/.minikube/config
(you may have to create the file config.json in this folder if you have no previous configuration)
Starting local Kubernetes cluster...
E0113 21:27:07.861621   12532 start.go:83] Error starting host: Error creating new host: dial tcp: missing address. Retrying.
E0113 21:27:07.876969   12532 start.go:83] Error starting host: Error creating new host: dial tcp: missing address. Retrying.
E0113 21:27:07.892771   12532 start.go:83] Error starting host: Error creating new host: dial tcp: missing address. Retrying.
E0113 21:27:07.892806   12532 start.go:89] Error starting host:  Error creating new host: dial tcp: missing address
Error creating new host: dial tcp: missing address
Error creating new host: dial tcp: missing address
Run Code Online (Sandbox Code Playgroud)

我试过:

  • 几乎所有关于 Github 问题的建议:27886792722942424
  • 安装(已经存在)libvirt-bin( libvirt-clients libvirt-daemon)
  • sudo virsh -c qemu:///system net-start default

也许还没准备好迎接黄金时段

Pab*_*chi 5

我终于找到了一个有效的解决方案,删除了 snap 包 ( sudo snap remove minikube),然后按照保留的官方指南之一进行操作kubectl

curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 \
&& sudo install minikube-linux-amd64 /usr/local/bin/minikube
Run Code Online (Sandbox Code Playgroud)

kubectl version和测试

$ kubectl get nodes
NAME       STATUS   ROLES    AGE   VERSION
minikube   Ready    master   25m   v1.12.4
Run Code Online (Sandbox Code Playgroud)

只运行仪表板

minikube dashboard
Run Code Online (Sandbox Code Playgroud)

我想知道其他人对使用LXD安装有什么看法