Minikube:远程错误 tls:证书错误
Minikube : remote error tls: bad certificate
我正在学习 Kubernetes 教程,无法 运行 第一个命令 (minikube start --vm-driver=hyperkit
)。我在 macOs Monterey 上使用 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
错误帮助了:
看来我已经玩过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
我正在学习 Kubernetes 教程,无法 运行 第一个命令 (minikube start --vm-driver=hyperkit
)。我在 macOs Monterey 上使用 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
错误帮助了:
看来我已经玩过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