kubernetes / ingress-nginx

Ingress NGINX Controller for Kubernetes
https://kubernetes.github.io/ingress-nginx/
Apache License 2.0
17.43k stars 8.24k forks source link

KIND supports loadbalancer with Cloud Provider KIND #12231

Open aojea opened 2 hours ago

aojea commented 2 hours ago

We can use a LoadBalancer Service with kind https://kind.sigs.k8s.io/docs/user/loadbalancer/

This simplifies the use of ingress a lot, and avoids to have to use portmaps https://kind.sigs.k8s.io/docs/user/ingress/

https://github.com/kubernetes/ingress-nginx/blob/dc3acbd7864816c464f3536f433aaabd3ea9a37e/deploy/static/provider/kind/deploy.yaml#L365

It also no longer needs the node selector

https://github.com/kubernetes/ingress-nginx/blob/dc3acbd7864816c464f3536f433aaabd3ea9a37e/deploy/static/provider/kind/deploy.yaml#L508

k8s-ci-robot commented 2 hours ago

This issue is currently awaiting triage.

If Ingress contributors determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.
longwuyuan commented 2 hours ago

Thanks for the info.

There is one more info that relates to this.

I create a kind cluster on linux and check the ipaddress of the kind container with docker inspect. Then I do vanilla install of Metallb. I put the docker inspect provided ipaddress of the kind container as the beginning + ending of the IPAddressPool for the L2 flavour config of metallb config. And then just install the ingress-nginx helm-chart.

This way I can point /etc/hosts entries to the IPAddress and get a full LB experience.

longwuyuan commented 2 hours ago

@aojea could you comment on what IPAddress is configured when kind is used on MacOS and Native-Windows(not WSL).

aojea commented 2 hours ago

https://github.com/kubernetes-sigs/cloud-provider-kind?tab=readme-ov-file#mac-and-windows-support

The one reported by the loadbalancer, no need to do anything, it works out of the box

https://kind.sigs.k8s.io/docs/user/loadbalancer/

aojea commented 2 hours ago

/assign