I work on an ingress controller called Voyager. I want to use kind for e2e testing instead of minikube.
The tests follow this pattern:
go test$(minikube ip):nodeport. I would like to do the same with kind. But the problem is that I don't know the nodeport ahead of time. If the extraPortMappings support port range, I could potentially use a single node kind cluster that forwards the default k8s nodeport range.
Do you think this can be supported? Is there any other alternative ideas?
If you are using linux you can reach the services using the KIND nodes ips
Ah! I did not know this. This solves my use-case.
Ah! I did not know this. This solves my use-case.
/close per last comment
Thanks for your feedback, there are also some examples on the github issues and the official docs exposing nodeports with KIND like this https://kind.sigs.k8s.io/docs/user/resources/#using-contour-ingress-with-kind
/close
@aojea: Closing this issue.
In response to this:
/close
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
If the extraPortMappings support port range, I could potentially use a single node kind cluster that forwards the default k8s nodeport range.
Are there any plans to support this feature?
I am actually interested in seeing this feature in kind, as I am using kind with docker-for-mac.
Thus, using NodePort services and extraPortMappings is my best option to expose k8s services for access (via localhost) from the host machine.
Still, if you want to use this approach for exposing services, you would need to know the assigned NodePort before creating the kind cluster to specify it in the cluster config. Therefore, setting the service's nodePort field to a specific number is the best solution I have for now, which is kind of cumbersome in my use-case, where Services are created in an automated fashion and get assigned random nodePorts from the kubelets nodePort range.
Long story short, it would be really nice to be able to expose the whole nodePort range in the kind cluster beforehand and not worrying about patching services inside the cluster.
Most helpful comment
Are there any plans to support this feature?
I am actually interested in seeing this feature in kind, as I am using kind with docker-for-mac.
Thus, using
NodePortservices andextraPortMappingsis my best option to expose k8s services for access (vialocalhost) from the host machine.Still, if you want to use this approach for exposing services, you would need to know the assigned NodePort before creating the kind cluster to specify it in the cluster config. Therefore, setting the service's
nodePortfield to a specific number is the best solution I have for now, which is kind of cumbersome in my use-case, where Services are created in an automated fashion and get assigned random nodePorts from the kubelets nodePort range.Long story short, it would be really nice to be able to expose the whole nodePort range in the kind cluster beforehand and not worrying about patching services inside the cluster.