我有以下服务:
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
rancher ClusterIP 10.245.162.197 <none> 80/TCP 10h我想给它分配一个外部IP。我试过:
kubectl expose deployment rancher --type=LoadBalancer --name=rancher-access但是外部IP仍然没有被分配.我用的是数字海洋库伯内特斯。
如何为服务获取外部IP。
发布于 2020-04-13 07:53:05
你有两个选择:
相反,您应该考虑使用NodePort服务或将ExternalIP附加到您的服务,并将公开的IP映射到数字海洋的浮动IP。
要获得实际的IP,您需要将ssh公开到网关水滴中,并通过访问元数据服务找到它的锚IP:
curl -s http://169.254.169.254/metadata/v1/interfaces/public/0/anchor_ipv4/addresshttps://github.com/hobby-kube/guide#bringing-traffic-to-the-cluster
https://stackoverflow.com/questions/61183343
复制相似问题