简体   繁体   English

Google容器引擎:Kubernetes在创建容器后不会暴露外部IP

[英]Google Container Engine: Kubernetes is not exposing external IP after creating container

I am trying to create a "Hello Node" sample application in Google Container Engine, following this tutorial 我正在尝试按照本教程在Google容器引擎中创建“Hello Node”示例应用程序

However even after running the command kubectl expose rc hello-node --type="LoadBalancer" , it is not exposing an external-IP to access the port. 但是,即使在运行命令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 片刻之后,负载均衡器的外部IP列在服务的IP(s)列中

Usually it's 1-2 minutes. 通常是1-2分钟。 You was waiting only 23seconds. 你只等了23秒。 Try to wait a few moments more and it'll be OK. 试着再等一会儿就行了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM