未能将我的pod暴露给互联网

时间:2016-04-07 21:36:11

标签: nginx docker kubernetes docker-compose dockerfile

我尝试了一些示例在我的kubernetes集群上运行特定图像,我执行了以下命令:

kubectl run my-nginx --image=nginx --replicas=2 --port=80

然后:

kubectl expose rc my-nginx --port=80 --type=LoadBalancer

当我走的时候:

kubectl get service

我明白了:

NAME         LABELS                                    SELECTOR       IP(S)         PORT(S)
kubernetes   component=apiserver,provider=kubernetes   <none>         10.0.0.1      443/TCP
my-nginx     run=my-nginx                              run=my-nginx   10.0.100.19   80/TCP

现在,我有一个我用kubernetes创建的集群,而且我想在浏览器中放一些东西,看看nginx的登陆页面......

我试图将我的主机ip与端口80放在一起但它没有用,我该怎么办? 谢谢!

描述svc:

Name:           my-nginx
Namespace:      default
Labels:         run=my-nginx
Selector:       run=my-nginx
Type:           LoadBalancer
IP:         x.x.xxx.xx
LoadBalancer Ingress:   dasfasdgfgaasok23o4j34ij4ofa69da-1772099277.us-west-2.elb.amazonaws.com
Port:           <unnamed>   80/TCP
NodePort:       <unnamed>   31331/TCP
Endpoints:      x.x.xxx.x:80,xx.xxx.x.x:80
Session Affinity:   None
No events.

0 个答案:

没有答案