我已经搜索了这个问题并看到了解决方案,但是我无法弄清楚这个问题。基本上,我无法使用复制控制器创建的外部IP /端口(我知道它将被弃用,尝试从头开始)。
$ kubectl run kubia-container --image=australia/kubia_py --port=8080 --generator=run/v1
kubectl run --generator=run/v1 is DEPRECATED and will be removed in a future version. Use kubectl run --generator=run-pod/v1 or kubectl create instead.
replicationcontroller/kubia-container created
$ kubectl get pods
NAME READY STATUS RESTARTS AGE
kubia-container-6b2cs 1/1 Running 0 25s
$ kubectl expose rc kubia-container --type=LoadBalancer --name kubia-http
service/kubia-http exposed
$ kubectl get pods,svc,rc
NAME READY STATUS RESTARTS AGE
pod/kubia-container-6b2cs 1/1 Running 0 93m
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/kubernetes ClusterIP 10.0.0.1 <none> 443/TCP 6h28m
service/kubia-http LoadBalancer 10.0.4.238 35.188.42.26 8080:30030/TCP 91m
$ curl 35.188.42.26:8080
curl: (7) Failed to connect to 35.188.42.26 port 8080: Connection refused