Ingress-nginx如何将NGINX Ingress的外部装置设置为仅1 IP外部IP
我在部署时使用YAML文件安装了NGINX入口,
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.2.0/deploy/static/provider/cloud/deploy.yaml
默认情况下,端点/externalips默认是我的节点的所有IP
,但我只希望1个外部设备能够访问我
尝试过的应用程序( https://kubernetes.github.io/ingress-nginx/ingress-nginx/user-guide/nginx-configuration/configmap/configmap/#bind-address-dress-dress-dress-dress )在配置文件中应用它,但它不起作用,我的configmap文件:
apiVersion: v1
data:
bind-address: "192.168.30.16"
kind: ConfigMap
metadata:
name: ingress-nginx-controller
我尝试了kubectl编辑svc/indress-nginx-controller -n in in ins in indress-nginx
以编辑svc添加外部装置,但是它仍然不起作用。
nginx Ingress文档中提到的唯一一件事是 https://kubernetes.github.io/ingress-nginx/deploy/baremetal/#external-ips ,但我尝试编辑SVC,然后更改后,它设置为单个IP,但后来又有RE RE RE - 再次添加IPS。好像在Ingress-nginx中有自动更新外部IPS机械师吗?
无论如何,是否可以将NGINX Ingress External IP设置为仅1个节点IP?我用尽了谷歌搜索的选择。希望有人可以帮助我
i installed nginx ingress with the yaml file
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.2.0/deploy/static/provider/cloud/deploy.yaml
when deploy i can see that the endpoints/externalIPs by default are all the ip of my nodes
but i only want 1 externalIPs to be access able to my applications
i had tried bind-address(https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/configmap/#bind-address) in a configuration file and applied it but it doesn't work, my ConfigMap file:
apiVersion: v1
data:
bind-address: "192.168.30.16"
kind: ConfigMap
metadata:
name: ingress-nginx-controller
I tried kubectl edit svc/ingress-nginx-controller -n ingress-nginx
to edit the svc adding externalIPs but it still doesn't work.
The only thing the nginx ingress document mentioned is https://kubernetes.github.io/ingress-nginx/deploy/baremetal/#external-ips but i tried editing the svc, after i changed, it was set to single IP, but later it re-add the IPs again. Seems like there an automatic update of external IPs mechanic in ingress-nginx?
Is there anyway to set nginx ingress externals ip to only 1 of the node ip? i'm running out of option for googling this. Hope someone can help me
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
可以访问您的服务以及IP/subnet/lameApce等,
但是,如果您希望“控制”谁 a href =“ https://kubernetes.io/docs/concepts/services-networking/network-policies/” rel =“ nofollow noreferrer”> https://kubernetes.io/docs.io/docs/docs/docs/conectes/concects/services-networking/networking/network-政策/
If you wish to "control" who can access your service(s) and from which ip/subnet/namesapce etc you should use
NetworkPolicy
https://kubernetes.io/docs/concepts/services-networking/network-policies/
取决于是否有针对您的群集实现的实现可能会按预期进行。
如果要使用指定的节点使用
类型:nodePort
https://kubernetes.io/docs/concepts/services-networking/service/service/#publishing/#publishise-services-services-services-service-service-types
可能也可能是使用 nodeSelector 以便您可以控制哪个节点出于DNS原因,NXINX控制器被安排为。
Dependent on whether there is a LoadBalancer implementation for your cluster that might as intended.
If you want to use a specified node use
type: NodePort
https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types
It might then also be useful to use a nodeSelector so you can control what node the nxinx controller gets scheduled to, for DNS reasons.