ubuntu - Minikube 是否在 Ubuntu 19.10 虚拟机中运行?
问题描述
我安装了 kubectl 和 minikube,如在 VMWare Workstation 中运行的 Ubuntu 19.10上的k8s 文档中所示。当我使用 --vm-driver=none 启动 minikube 时(因为我在虚拟机上运行)我收到此错误:
minikube v1.6.2 on Ubuntu 19.10
Selecting 'none' driver from user configuration (alternates: [])
Tip: Use 'minikube start -p <name>' to create a new cluster, or 'minikube delete' to delete this one.
Using the running none "minikube" VM ...
Waiting for the host to be provisioned ...
Preparing Kubernetes v1.17.0 on Docker '19.03.2' ...
kubelet.resolv-conf=/run/systemd/resolve/resolv.conf
Launching Kubernetes ...
Error starting cluster: running cmd: /bin/bash -c "sudo env PATH=/var/lib/minikube/binaries/v1.17.0:$PATH kubeadm init phase certs all --config /var/tmp/minikube/kubeadm.yaml": /bin/bash -c "sudo env PATH=/var/lib/minikube/binaries/v1.17.0:$PATH kubeadm init phase certs all --config /var/tmp/minikube/kubeadm.yaml": exit status 1
stdout:
[certs] Using certificateDir folder "/var/lib/minikube/certs"
[certs] Using existing ca certificate authority
[certs] Using existing apiserver certificate and key on disk
stderr:
W0110 13:53:06.531592 6051 common.go:77] your configuration file uses a deprecated API spec: "kubeadm.k8s.io/v1beta1". Please use 'kubeadm config migrate --old-config old.yaml --new-config new.yaml', which will write the new, similar spec using a newer API version.
W0110 13:53:06.532094 6051 common.go:77] your configuration file uses a deprecated API spec: "kubeadm.k8s.io/v1beta1". Please use 'kubeadm config migrate --old-config old.yaml --new-config new.yaml', which will write the new, similar spec using a newer API version.
W0110 13:53:06.533419 6051 validation.go:28] Cannot validate kube-proxy config - no validator is available
W0110 13:53:06.533440 6051 validation.go:28] Cannot validate kubelet config - no validator is available
error execution phase certs/apiserver-kubelet-client: [certs] certificate apiserver-kubelet-client not signed by CA certificate ca: crypto/rsa: verification error
To see the stack trace of this error execute with --v=5 or higher
minikube is exiting due to an error. If the above message is not useful, open an issue:
https://github.com/kubernetes/minikube/issues/new/choose
❌ Problems detected in kube-addon-manager ["c7ccb7eb00cc"]:
error: You must be logged in to the server (error when retrieving current configuration of:
error: You must be logged in to the server (the server has asked for the client to provide credentials)
error: You must be logged in to the server (the server has asked for the client to provide credentials)
❌ Problems detected in kube-apiserver ["c91043e54554"]:
I0110 20:52:44.283421 1 log.go:172] http: TLS handshake error from 127.0.0.1:47838: remote error: tls: bad certificate
I0110 20:52:44.483603 1 log.go:172] http: TLS handshake error from 127.0.0.1:47846: remote error: tls: bad certificate
I0110 20:52:44.549909 1 log.go:172] http: TLS handshake error from 127.0.0.1:47848: remote error: tls: bad certificate
这是使用版本 5 内核的 Ubuntu 19.10 的问题,还是在 VM 中运行的结果,是否有解决方法?
谢谢。
解决方案
是的,它应该工作。
以下说明应适用于 Debian / Ubuntu / Mint Linux 发行版。如果使用 RHEL / Arch / Other 发行版或非桌面发行版(如 Ubuntu 服务器)或可能省略许多预期工具的轻量级发行版,您的体验可能会有所不同。
安装 VirtualBox:
找到你的 Linux 发行版并下载.deb
软件包,这里使用图形安装程序就足够了。如果您使用像apt
从终端安装的包管理器,您可能会得到一个相当过时的版本。
https://www.virtualbox.org/wiki/Linux_Downloads
安装后,检查您的安装以确保它正常工作:
VBoxManage —version
作为替代方案,您可以使用(或者可能必须使用)KVM 而不是 VirtualBox。以下是可以在这篇文章中找到的一些很好的说明:
https://computingforgeeks.com/install-kvm-centos-rhel-ubuntu-debian-sles-arch/
安装 Kubectl
在您的终端中运行以下命令:
curl -LO 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
sudo mv ./kubectl /usr/local/bin/kubectl
检查您的安装:
kubectl version
另见官方文档: https ://kubernetes.io/docs/tasks/tools/install-kubectl/#install-kubectl-on-linux
安装 Minikube
在您的终端中运行以下命令:
curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 && chmod +x minikube
sudo install minikube /usr/local/bin
检查您的安装:
minikube version
启动 Minikube:
minikube start
另见官方文档:
推荐阅读
- python - Plotly:将线添加到条形图
- node.js - 如何模拟同一路径的不同响应?
- android - ViewFlipper 不显示任何图像
- android - 从 iPhone 拍摄的照片在 Android 手机上旋转 90 度
- php - Opencart 2.x - 客户组 ID 返回为 0
- wordpress - 将此视频右对齐
- java - 如何将第一个图像从 ArrayList 设置为 imageView
- android-studio - Search-Everywhere in Android Studio (IntelliJ) 使搜索文件变得多余?
- apache-nifi - 如何远程访问 NiFi?
- python - 使用 ConnectionPatch 在 imshow 热图之间创建链接