【发布时间】:2021-11-20 18:20:10
【问题描述】:
我已经在 EC2 Linux Instance 中安装了 minikube。
Minikube IP : 192.168.49.2,
EC2 Instance IP: 10.X.X.X
我已将应用程序部署为 NodePort 服务类型,其中
port: 80
targetPort: 80
nodePort: 32768
and able to access it with curl http://192.168.49.2:32768 within the cluster.
我应该如何向外界公开这个应用程序?
如果端口转发是选项,那么我尝试了以下方法:
kubectl port-forward --address <InstanceIP> svc/my-service 8888:80
这总是报错:
Unable to listen on port 5000:
Listeners failed to create with the following errors:
[unable to create listener] error:
unable to listen on any of the requested ports: [{8888 80}]
我确定端口 8888 上没有运行任何服务。
kubectl port-forward --address <InstanceIP> svc/my-service 8888:32768
这表示,错误:
Service my-service does not have a service port 32768.
感谢任何帮助
【问题讨论】:
标签: kubernetes kubernetes-helm kubernetes-ingress minikube