Google 容器引擎:Kubernetes 在创建容器后未公开外部 IP
Google Container Engine: Kubernetes is not exposing external IP after creating container
我正在尝试在 Google 容器引擎中创建一个 "Hello Node" 示例应用程序,然后 tutorial
然而,即使在 运行 命令 kubectl expose rc hello-node --type="LoadBalancer"
之后,它也没有暴露外部 IP 来访问端口。
vagrant@docker-host:~/node-app$ kubectl run hello-node --image=gcr.io/${PROJECT_ID}/hello-node:v1 --port=8080
replicationcontroller "hello-node" created
vagrant@docker-host:~/node-app$ kubectl expose rc hello-node --type="LoadBalancer"
service "hello-node" exposed
vagrant@docker-host:~/node-app$ kubectl get services hello-node
NAME CLUSTER_IP EXTERNAL_IP PORT(S) SELECTOR AGE
hello-node 10.163.248.xxx 8080/TCP run=hello-node 14s
vagrant@docker-host:~/node-app$ kubectl get services hello-node
NAME CLUSTER_IP EXTERNAL_IP PORT(S) SELECTOR AGE
hello-node 10.163.248.xxx 8080/TCP run=hello-node 23s
After a few moments, the external IP of the load balancer is listed in
the IP(s) column of the service
通常是 1-2 分钟。你只等了 23 秒。尝试多等一会儿就OK了。
我正在尝试在 Google 容器引擎中创建一个 "Hello Node" 示例应用程序,然后 tutorial
然而,即使在 运行 命令 kubectl expose rc hello-node --type="LoadBalancer"
之后,它也没有暴露外部 IP 来访问端口。
vagrant@docker-host:~/node-app$ kubectl run hello-node --image=gcr.io/${PROJECT_ID}/hello-node:v1 --port=8080
replicationcontroller "hello-node" created
vagrant@docker-host:~/node-app$ kubectl expose rc hello-node --type="LoadBalancer"
service "hello-node" exposed
vagrant@docker-host:~/node-app$ kubectl get services hello-node
NAME CLUSTER_IP EXTERNAL_IP PORT(S) SELECTOR AGE
hello-node 10.163.248.xxx 8080/TCP run=hello-node 14s
vagrant@docker-host:~/node-app$ kubectl get services hello-node
NAME CLUSTER_IP EXTERNAL_IP PORT(S) SELECTOR AGE
hello-node 10.163.248.xxx 8080/TCP run=hello-node 23s
After a few moments, the external IP of the load balancer is listed in the IP(s) column of the service
通常是 1-2 分钟。你只等了 23 秒。尝试多等一会儿就OK了。