Google容器引擎:创建容器后,Kubernetes不公开外部IP [英] Google Container Engine: Kubernetes is not exposing external IP after creating container

查看:167
本文介绍了Google容器引擎:创建容器后,Kubernetes不公开外部IP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在Google Container Engine中创建一个Hello Node示例应用程序,并遵循 tutorial

然而,即使运行命令 kubectl公开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 
replicationcontrollerhello-nodecreated
vagrant @ docker-host:〜/ node-app $ kubectl expose rc hello-node --type =LoadBalancer
服务hello-node暴露
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-主机:〜/ node-app $ kubectl获取服务hello-node
NAME CLUSTER_IP EXTERNAL_IP PORT(S)SELECTOR AGE
hello-node 10.163.248.xxx 8080 / TCP run = hello-node 23s



过了一会儿,负载均衡器的外部IP被列在
IP列中的服务


通常为1-2分钟。你只等了23秒。试着再等一会儿,它会好的。


I am trying to create a "Hello Node" sample application in Google Container Engine, following this tutorial

However even after running the command kubectl expose rc hello-node --type="LoadBalancer", it is not exposing an external-IP to access the port.

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

Usually it's 1-2 minutes. You was waiting only 23seconds. Try to wait a few moments more and it'll be OK.

这篇关于Google容器引擎:创建容器后,Kubernetes不公开外部IP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆