我坐在防火墙后面,所以我安装了vpn。代理是127.0.0.1,端口是1080.我使用win10,因为使用Oracle虚拟盒而禁用了Hyper-V。
我按照link在Windows中安装minikube。以下屏幕是我的命令和响应之间的交互。 / 1 /第1步
PS C:\temp> minikube start
Starting local Kubernetes v1.9.4 cluster...
Starting VM...
Downloading Minikube ISO
142.22 MB / 142.22 MB [============================================] 100.00% 0s
Getting VM IP address...
Moving files into cluster...
Downloading localkube binary
163.02 MB / 163.02 MB [============================================] 100.00% 0s
0 B / 65 B [----------------------------------------------------------] 0.00%
65 B / 65 B [======================================================] 100.00% 0sSetting up certs...
Connecting to cluster...
Setting up kubeconfig...
Starting cluster components...
Kubectl is now configured to use the cluster.
Loading cached images from config file.
第1步似乎没问题。然后第2步:
PS C:\temp> minikube docker-env
$Env:DOCKER_TLS_VERIFY = "1"
$Env:DOCKER_HOST = "tcp://192.168.99.100:2376"
$Env:DOCKER_CERT_PATH = "C:\Users\Administrator\.minikube\certs"
$Env:DOCKER_API_VERSION = "1.23"
# Run this command to configure your shell:
# & minikube docker-env | Invoke-Expression
步骤2似乎还可以。然后我步骤3:
PS C:\temp> minikube docker-env | Invoke-Expression
第3步看起来不错。然后我尝试第4步:
PS C:\temp> docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
第4步,在这里,我有一些疑问,为什么我没有与作者相同的图像。 作者图片如下:
images get by instruction link's author
好吧,我继续执行第5步:
PS C:\GoWorkspace\src\hello> docker build -t dummy:v0 .
Sending build context to Docker daemon 3.584kB
Step 1/2 : FROM golang:onbuild
onbuild: Pulling from library/golang
ad74af05f5a2: Pull complete
2b032b8bbe8b: Pull complete
a9a5b35f6ead: Pull complete
25d9840c55bc: Pull complete
d792ec7d64a3: Pull complete
be556a93c22e: Pull complete
3a5fce283a1e: Pull complete
0621865a0c2e: Pull complete
Digest: sha256:c0ec19d49014d604e4f62266afd490016b11ceec103f0b7ef44875801ef93f36
Status: Downloaded newer image for golang:onbuild
# Executing 3 build triggers...
Step 1/1 : COPY . /go/src/app
Step 1/1 : RUN go-wrapper download
---> Running in e808b8afc9fa
+ exec go get -v -d
github.com/gorilla/mux (download)
Step 1/1 : RUN go-wrapper install
---> Running in 3afb95a832a9
+ exec go install -v
github.com/gorilla/mux
app
---> 3bd1e6e9ee1c
Removing intermediate container e808b8afc9fa
Removing intermediate container 3afb95a832a9
Step 2/2 : EXPOSE 8500
---> Running in 336c84317529
---> 2dfb9e9d53ec
Removing intermediate container 336c84317529
Successfully built 2dfb9e9d53ec
Successfully tagged dummy:v0
SECURITY WARNING: You are building a Docker image from Windows against a non-Windows Docker host. All files and directories added to build context will have '-rwxr-xr-x' permissions. It is recommended to double check and reset permissions for sensitive files and directories.
看起来不错。然后第6步:
PS C:\GoWorkspace\src\hello> docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
dummy v0 2dfb9e9d53ec 20 seconds ago 706MB
golang onbuild 5d82e356477f 8 months ago 699MB
步骤6看起来没问题,然后是第7步:
PS C:\GoWorkspace\src\hello> docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
dummy v0 2dfb9e9d53ec 20 seconds ago 706MB
golang onbuild 5d82e356477f 8 months ago 699MB
步骤7看起来没问题,然后是第8步:
PS C:\GoWorkspace\src\hello> kubectl run hello-universe --image=dummy:v0 --port=8500
deployment "hello-universe" created
步骤8,看起来没问题,然后是第9步:
PS C:\GoWorkspace\src\hello> kubectl get pods
NAME READY STATUS RESTARTS AGE
hello-universe-779b57d89f-kxrwr 0/1 ContainerCreating 0 4s
在这里,我怀疑pod hello-universe不是Ready。在上面提到的链接the author has 1/1 mark, which means pod is ready. click to see the image中,我得到了0/1。这是否意味着我的吊舱尚未准备好? 无论如何,我继续第10步:
PS C:\GoWorkspace\src\hello> kubectl expose deployment hello-universe --type="LoadBalancer"
service "hello-universe" exposed
看起来没问题,然后继续执行步骤11:
PS C:\GoWorkspace\src\hello> kubectl get services
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
hello-universe LoadBalancer 10.108.204.167 <pending> 8500:31376/TCP 13s
kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 9m
最后,我尝试获取服务URL(步骤12),并显示以下错误消息:
PS C:\GoWorkspace\src\hello> minikube service hello-universe --url
Waiting, endpoint for service is not ready yet...
Waiting, endpoint for service is not ready yet...
Waiting, endpoint for service is not ready yet...
Waiting, endpoint for service is not ready yet...
...
...
Waiting, endpoint for service is not ready yet...
Waiting, endpoint for service is not ready yet...
Error opening service: Could not find finalized endpoint being pointed to by hello-universe: Temporary Error: Endpoint for service is not ready yet
Temporary Error: Endpoint for service is not ready yet
Temporary Error: Endpoint for service is not ready yet
Temporary Error: Endpoint for service is not ready yet
通过一些搜索互联网,我注意到当我启动minikube时,我将使用代理标签,我有其他类型的错误。我将创建另一个问题,但这一次,问题将是短暂的。谢谢你阅读我这么懒散的问题。 minikube以代理开头的命令是 at this link 。