-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Adds Dnsimple as new provider #224
Conversation
6f819a3
to
e091def
Compare
@jose5918 thanks for PR ! Kind request to either:
|
@ideahitme Let me know if that looks better for you guys or if you'd prefer additional changes |
Glanced over it and looks good. I'll try it out this week. Thank you @jose5918. |
provider/dnsimple_test.go
Outdated
|
||
type mockDnsimpleZonesService struct{} | ||
|
||
func (m *mockDnsimpleZonesService) ListZones(accountID string, options *dnsimple.ZoneListOptions) (*dnsimple.ZonesResponse, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kind request to use testify/mock instead of mocking separate service for each type of expected response :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i know we are using this pattern in other dns providers, but tests are getting incredibly bloated and difficult to read, so we need to take time to refactor existing tests as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ideahitme Sure thing. Also let me know if I should make any changes related to this issue #228
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, sorry for keep you waiting. We will try to review this PR in the next few days. Thanks a lot for support ;)
@jose5918 I merged in master and fixed some conflicts. Hope that's ok. |
Tested it out in my account. Initial record creation of records works fine: $ external-dns --source service --domain-filter linki.space --provider dnsimple --namespace INFO[0001] Changing records: CREATE {0 0 A myapp.linki.space 146.148.123.148 0 0 false [] }
INFO[0001] Changing records: CREATE {0 0 TXT myapp.linki.space "heritage=external-dns,external-dns/owner=linki-local" 0 0 false [] } But then I found a couple of issues: On the second iteration it throw an error: $ external-dns --source service --domain-filter linki.space --provider dnsimple --namespace external-dns-test --registry=txt --txt-owner-id=linki-local
INFO[0001] Changing records: CREATE {0 0 A myapp.linki.space 146.148.123.148 0 0 false [] }
ERRO[0001] POST https://api.dnsimple.com/v2/61844/zones/linki.space/records: 400 Zone record already exists Then I removed the annotation so that it would delete the record. Also got an error: $ external-dns --source service --domain-filter linki.space --provider dnsimple --namespace external-dns-test --registry=txt --txt-owner-id=linki-local
INFO[0001] Changing records: DELETE {0 0 A myapp 146.148.123.148 0 0 false [] }
ERRO[0001] GET https://api.dnsimple.com/v2/61844/zones//records: 404 Zone `records` not found |
@linki Alright I will look into seeing what I broke. Looks like I had some mistakes in the unit test so I likely broke the delete functionality without realizing it when doing some cleanup. |
@linki It should be fixed now. Here is an example test
@ideahitme Is this sort of what you had in mind with the testify mock tests? |
@jose5918 sorry for keep you waiting. I will merge the conflict on this branch and review your PR :) |
Hi @jose5918 could you please remove the provider/mocks/ package entirely and define mocks in the provider/dnsimple_test.go I would avoid using auto-generated code for a simple task of defining a mock |
@ideahitme Closing was an accident, meant to just let you know that I would make the changes. |
@jose5918 will test again and then come back here |
@linki any news? |
@jose5918 I merged master, fixed some conflicts, added dnsimple's go code, removed the need for I just tested all the combinations I can think of against an AWS and GKE cluster (CNAME vs. A record) and it worked perfectly fine. This is a strong good to go. Thanks @jose5918, great work! 👍 |
Thank you, @jose5918 😻 |
You might want to add a markdown document here as well https://github.com/kubernetes-incubator/external-dns/tree/master/docs/tutorials to help other users setup DNSimple with external-dns. |
@MichielDeMey Good suggestion. Would you be willing to write a tutorial for DNSimple @jose5918? |
@linki I can write a tutorial, but I no longer have a dnsimple account to verify against so I can't verify that my documentation will be correct |
@jose5918 I could verify your steps. I have a DNSimple account and running Kubernetes 1.8.4.
Please let me know. Thanks for your work! |
@arno01 https://gist.github.com/jose5918/26d184d90fb4b9c7c045c8d71e2ec4c5 Let me know if it works with those instructions. It's been a while and I think I first tried it on Kubernetes 1.6 |
@jose5918 thanks for the instruction! I have tried it with my configuration, unfortunately it did not work as I expected. Maybe I am doing something wrong... I do not have a I followed the instruction with the following changes:
Then, I had to create the RBAC file
My K8s nodes and their external IPs:
The logs from external-dns v0.4.8:
I can see that external-dns is trying to set the External IP of my K8s nodes which is not helping much since it is in a Class A (private internet), e.g. Probably there has to be some way that would be finding out what is my actual public IP or a way to set it in the configuration. Then there was no message coming regarding the before mentioned Not sure why is it continuously trying to do Please let me know if all this is expected or if I am doing something wrong. Thanks! |
Humm, it appears it somehow created a duplicate record with the same
See the screenshot: Upd I have also noticed one A record added was |
* Adds Dnsimple as a provider * chore(vendor): remove vendor for smaller diff * fix(config): make dnsimple selectable via flags * Fix delete and update * Dnsimple testify mock tests * remove leaked file * Move and simplify mock functions * chore: use lowercase for logrus repository * chore: update dependencies using glide * chore: vendor dnsimple-go package * ref: isolate suitable type in source package * add support for DNSimple, thx @jose5918 :D
This PR adds Dnsimple as a provider option. I was just having a bit of trouble adding dnsimple's go library as a dependency with glide (Still a bit new with Go).
Edit: Got glide to run but seems it added a way more files than necessary