Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for NodePort services #559

Merged
merged 8 commits into from
Jun 14, 2018
Merged

Conversation

grimmy
Copy link
Contributor

@grimmy grimmy commented May 15, 2018

Initial work towards support for NodePort services for #191.

I'm a little lost on how to get some fake nodes into the testing harness so any help would be appreciated. I also haven't been able to test this yet as my dev cluster is in bad shape at the moment.

Any input would be greatly appreciated. I went with a poll on update due to the rest of the application not using the event stream. This poll is done once and passed through the update process.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels May 15, 2018
@linki
Copy link
Member

linki commented May 16, 2018

Thanks for working on this @grimmy.

Adding some test Nodes is fairly easy. Just create them the same way as you create test Services (https://github.com/kubernetes-incubator/external-dns/pull/559/files#diff-8baa5800e3e2b291d315e890b1b15f48R1110) via the fake client.

Here is an example: https://github.com/linki/armor-ingress-controller/blob/master/controller/controller_test.go#L795-L817

@linki
Copy link
Member

linki commented May 16, 2018

If it helps you can also look at how we did NodePorts in mate: https://github.com/linki/mate/blob/master/producers/node_ports.go (It looks very similar.)

@linki
Copy link
Member

linki commented May 16, 2018

We have to rework the whole sync vs. watch approach (#484). However, let's tackle this independently and go with the current design for this feature.

My main concern is that the implementation fetches the NodeList for every Service on every iteration. This we should definitely avoid. I think one request for the node list in each interation is fine.

@Raffo Raffo changed the title WIP: First stab at NodePort support. Testing incomplete WIP: First stub at NodePort support. Testing incomplete May 19, 2018
@grimmy
Copy link
Contributor Author

grimmy commented May 31, 2018

Just wanted to ping here that I'm still working on this. I just updated it add an SRV record for each port in the service.

That said I still need to figure out how to handle clusters that don't have external addresses and how that ties into private dns zones.

Also the travis failure is unrelated to this PR, just a gofmt -s that slipped through and made it to master.

@grimmy grimmy changed the title WIP: First stub at NodePort support. Testing incomplete First stub at NodePort support. Jun 4, 2018
@grimmy
Copy link
Contributor Author

grimmy commented Jun 4, 2018

@linki This should be good to go now. I'ved tested on my cluster with route 53 and everything is good. I set the priority to 0 and weight to 50 for now. The priority should be the same across the cluster and be fine at zero, but I put the weight at 50 just in case anyone needs to tinker with it for whatever reason.

@grimmy grimmy changed the title First stub at NodePort support. Add support for NodePort services Jun 4, 2018
@njuettner
Copy link
Member

@linki WDYT? anything missing or can we merge this PR?

@linki
Copy link
Member

linki commented Jun 14, 2018

LGTM, thanks a lot @grimmy 👍

@linki linki merged commit 2ee4b2e into kubernetes-sigs:master Jun 14, 2018
@hjacobs
Copy link
Contributor

hjacobs commented Jun 14, 2018

@linki @njuettner does it mean that External DNS now has all features to replace kops' DNS controller?

@grimmy
Copy link
Contributor Author

grimmy commented Jun 14, 2018

You're very welcome @linki thanks for the merge!! :-D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants