如何为Kubernetes集群分配IP?

问题描述 投票:0回答:1

我已经通过Rancher安装了K8S集群,它已经启动并正在运行。为了进行测试,我部署了一个helloworld nginx pod:

enter image description here

要调用服务,我必须调用NodePort IP地址,例如:

http://111.111.111.111:30359/

但是我想用一个名字来称呼它,例如:

https://helloworld.co.example.org

已安装入口控制器Nginx:

NAMESPACE       NAME                   TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)                  AGE
default         kubernetes             ClusterIP   10.43.0.1       <none>        443/TCP                  162m
dev             helloworld             ClusterIP   10.43.187.230   <none>        80/TCP                   17m
dev             helloworld-nodeport    NodePort    10.43.9.147     <none>        80:30359/TCP             17m
ingress-nginx   default-http-backend   ClusterIP   10.43.86.105    <none>        80/TCP                   161m
kube-system     kube-dns               ClusterIP   10.43.0.10      <none>        53/UDP,53/TCP,9153/TCP   161m
kube-system     metrics-server         ClusterIP   10.43.220.198   <none>        443/TCP                  161m

但是它没有EXTERNAL-IP。问题是,如何获得它。

kubernetes rancher
1个回答
0
投票
指南中需要注意的一件事是,您需要具有一个将在入口规则中使用的注册真实域名。
© www.soinside.com 2019 - 2024. All rights reserved.