我正在嘗試從瀏覽器訪問一個簡單的 minikube 集群,但我不斷收到以下資訊:
? Because you are using a Docker driver on windows, the terminal needs to be open to run it.
我為集群創建了一個外部服務,埠號為 30384,我在 docker 容器中運行 minikube。
我正在按照“Hello Minikube”示例來創建我的部署。
Step1:我創建了部署:
kubectl create deployment hello-node --image=k8s.gcr.io/echoserver:1.4
Step2:我創建了外部服務:
kubectl expose deployment hello-node --type=LoadBalancer --port=8080
第 3 步:我運行了該服務,而那是我填塞的地方“minikube service hello-node
完整的回傳資訊:
? Executing "docker container inspect minikube --format={{.State.Status}}" took an unusually long time: 2.3796077s
?? Restarting the docker service may improve performance.
?? Starting tunnel for service hello-node.
?? Opening service default/hello-node in default browser...
? Because you are using a Docker driver on windows, the terminal needs to be open to run it.
我嘗試運行該服務以使其可以從瀏覽器訪問,但是,我無法做到。
uj5u.com熱心網友回復:
我通過將 minikube 基本驅動程式從 docker 更改為 hyperv 解決了同樣的問題。
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All
之后您的電腦將重新啟動,您可以說
minikube config set driver hyperv
然后minikube start將從該驅動程式開始。
這對我有用。
uj5u.com熱心網友回復:
您可以使用 kubectl 的埠轉發功能來完成這項作業。例如,如果您正在運行hello-node服務:
kubectl port-forward svc/hello-node 27017:27017
這將暴露服務localhost:27017
您也可以使用相同的命令提及您的 pod 而不是服務,您只需指定您的pods/pod-name,您可以通過以下方式驗證您的 pod 名稱kubectl get pods
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/456908.html
標籤:码头工人 Kubernetes 迷你库贝
