Closed scottnetlab closed 3 years ago
Thanks for bringing this up :bow:
The problem stems from the Kong Kubernetes Testing Framework using Kubernetes In Docker (KIND) as the default cluster implementation for tests, and expecting that LoadBalancer
type services that use Docker network IP addresses (utilized via MetalLB) will be rout-able from the host. The history behind this comes from the CI running on Linux, and the maintainers up until recently all using Linux development systems: for Linux this is true, as the iptables and routing rules by default will allow the host to access the Docker network when Docker is running natively on the same host, but the same is not true on Mac as it can't run Docker natively and it often connects to Docker in a VM or on an external Linux system.
There are a few different options on how we can fix this:
LoadBalancer
services as the mechanism to communicate with cluster services during tests and use the Kubernetes API port-forwarding mechanism insteadkind
based testing deployments that will allow MacOS hosts to connect to the LoadBalancer
IPs directlyPersonally I think option 1 is the quickest, option 2 is the most complete (but I don't personally use macos so I'm limited some in my ability to help), and option 3 could really just stop us from ever needing any special rules to run the tests but probably is the longest of the 3 options to implement and introduces some other considerations.
We would like to hear back from you on your thoughts and preference in this matter, let us know if you have a preference as a contributor, and if you are interested in or able to directly contribute to the fix?
As an immediate workaround: In next
right now there is some preliminary support for running the integration test suite against a GKE cluster. This is not well matured functionality yet so if you're interested in using it feel free to reach out here for help, and its not ideal because it may end up costing extra money, but just to note that it is technically an option.
Thanks for the response @shaneutt ! I believe option 2 is what I'm looking for as it provides the most similar environment to a working installation as well as the most complete coverage for developers for the project. My workaround has simply been to use a Linux VM in AWS, which has been sufficient in the short-term.
I may have some time to contribute a fix for MacOS, however it may be a few weeks, as I've got a lot going on both during and after work :)
I believe that the configuration (whatever that may look like in the end) should end up in the testing framework repo at https://github.com/Kong/kubernetes-testing-framework. Please let me know if I should open an issue over there as well, or if this issue will suffice.
Sounds good, no rush on anything. This does belong over in the testing framework, I think we should probably keep this issue open for posterity and in case anyone else comes along with the same problem (because it's not obvious I think for most people to go check out ktf) and feel free to open a new issue in KTF for the specific action (number 2 above). :+1:
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Is there an existing issue for this?
Current Behavior
When I run integration tests from my MacOS system, I cannot connect to the KIND cluster in which the integration tests deploy.
As per Docker's own documentation, this is not possible without a workaround. See https://docs.docker.com/docker-for-mac/networking/.
Expected Behavior
Integration tests should run on MacOS as they do on Linux to provide a seamless developer experience across platforms.
Steps To Reproduce
Kong Ingress Controller version
Kubernetes version
Anything else?
Suggest potentially using
--network host
with the KIND cluster (is possible) when the underlying OS is Mac. We have done that in some past projects I've worked on to get this working on Mac. See https://github.com/vmware-tanzu-labs/reference-platform-for-kubernetes/blob/develop/Makefile#L33 for an example.