问题描述
嗨,我一直关注this video。使用 kubectl describe
显示创建的 Service 收益
$ kubectl describe -n ingress-nginx service/ingress-nginx
Name: ingress-nginx
Namespace: ingress-nginx
Labels: <none>
Annotations: <none>
Selector: app=nginx-ingress
Type: LoadBalancer
IP: 10.110.231.177
LoadBalancer Ingress: localhost
Port: http 80/TCP
TargetPort: http/TCP
NodePort: http 32352/TCP
Endpoints: 10.1.0.12:80,10.1.0.13:80
Port: https 443/TCP
TargetPort: https/TCP
NodePort: https 30563/TCP
Endpoints: 10.1.0.12:443,10.1.0.13:443
Session Affinity: None
External Traffic Policy: Local
HealthCheck NodePort: 30574
Events: <none>
为什么我没有获得视频作者解释的公共 IP 地址?这就是我无法访问链接 http://marcel.test 的原因吗?
此外,在 AWS 上进行相同设置时,LoadBalancer 服务的外部 IP 保持在 Pending
。
解决方法
我使用的主机文件不正确,因为我使用的是 git bash 我 vim 进入 /etc/hosts
但实际上 windows 中的主机文件是 C:\Windows\System32\drivers\etc
所以我用 127.0.0.1 marcel 更新了主机文件.test 成功了