我正在学习Kubernetes教程,无法运行第一个命令(minikube start --vm-driver=hyperkit
(。我在蒙特利的macOs上使用的是MacBook Pro Intel。由于TLS错误,我无法使其工作。
$ minikube start --vm-driver=hyperkit
😄 minikube v1.25.2 on Darwin 12.2.1
🆕 Kubernetes 1.23.3 is now available. If you would like to upgrade, specify: --kubernetes-version=v1.23.3
✨ Using the hyperkit driver based on existing profile
👍 Starting control plane node minikube in cluster minikube
🔄 Restarting existing hyperkit VM for "minikube" ...
🐳 Preparing Kubernetes v1.20.2 on Docker 20.10.3 ...
❌ Problems detected in etcd [592b8a58065e]:
2022-03-19 22:12:03.193985 I | embed: rejected connection from "127.0.0.1:38132" (error "remote error: tls: bad certificate", ServerName "")
我试过了:
- 重新启动计算机:https://github.com/kubernetes/minikube/issues/4329
- 已使用
--embed-certs
参数
$ minikube start --vm-driver=hyperkit --embed-certs
😄 minikube v1.25.2 on Darwin 12.2.1
🆕 Kubernetes 1.23.3 is now available. If you would like to upgrade, specify: --kubernetes-version=v1.23.3
✨ Using the hyperkit driver based on existing profile
👍 Starting control plane node minikube in cluster minikube
🔄 Restarting existing hyperkit VM for "minikube" ...
🐳 Preparing Kubernetes v1.20.2 on Docker 20.10.3 ...
❌ Problems detected in etcd [78d1e36569b8]:
2022-03-19 22:20:53.503532 I | embed: rejected connection from "127.0.0.1:34926" (error "remote error: tls: bad certificate", ServerName "")
我是K8s的新手,是什么原因导致了这种行为?
我用自制软件安装了minikube和hyperkit。当我显示kubectl版本时,我得到了另一个连接错误:
kubectl version
Client Version: version.Info{Major:"1", Minor:"22", GitVersion:"v1.22.5", GitCommit:"5c99e2ac2ff9a3c549d9ca665e7bc05a3e18f07e", GitTreeState:"clean", BuildDate:"2021-12-16T08:38:33Z", GoVersion:"go1.16.12", Compiler:"gc", Platform:"darwin/amd64"}
Unable to connect to the server: dial tcp 192.168.64.2:8443: i/o timeout
kubectl version
错误有助于:无法连接到服务器:拨号tcp i/o超时
我好像已经玩过k8s:了
$ kubectl config view
apiVersion: v1
clusters:
- cluster:
certificate-authority: /Users/xxx/.minikube/ca.crt
extensions:
- extension:
last-update: Sat, 13 Mar 2021 13:40:06 CET
provider: minikube.sigs.k8s.io
version: v1.18.1
name: cluster_info
server: https://192.168.64.2:8443
name: minikube
contexts:
- context:
cluster: minikube
extensions:
- extension:
last-update: Sat, 13 Mar 2021 13:40:06 CET
provider: minikube.sigs.k8s.io
version: v1.18.1
name: context_info
namespace: default
user: minikube
name: minikube
current-context: minikube
kind: Config
preferences: {}
users:
- name: minikube
user:
client-certificate: /Users/xxx/.minikube/profiles/minikube/client.crt
client-key: /Users/xxx/.minikube/profiles/minikube/client.key
首先我删除了现有的集群:
$ kubectl config delete-cluster minikube
deleted cluster minikube from /Users/xxx/.kube/config
然后运行
$ minikube delete
🔥 Deleting "minikube" in hyperkit ...
💀 Removed all traces of the "minikube" cluster.
最后:
$ minikube start --vm-driver=hyperkit
😄 minikube v1.25.2 on Darwin 12.2.1
✨ Using the hyperkit driver based on user configuration
👍 Starting control plane node minikube in cluster minikube
💾 Downloading Kubernetes v1.23.3 preload ...
> preloaded-images-k8s-v17-v1...: 505.68 MiB / 505.68 MiB 100.00% 923.34 K
🔥 Creating hyperkit VM (CPUs=2, Memory=4000MB, Disk=20000MB) ...
🐳 Preparing Kubernetes v1.23.3 on Docker 20.10.12 ...
▪ kubelet.housekeeping-interval=5m
▪ Generating certificates and keys ...
▪ Booting up control plane ...
▪ Configuring RBAC rules ...
🔎 Verifying Kubernetes components...
▪ Using image gcr.io/k8s-minikube/storage-provisioner:v5
🌟 Enabled addons: default-storageclass, storage-provisioner
🏄 Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default