-
Notifications
You must be signed in to change notification settings - Fork 2.4k
plugin/nomad: Add a Nomad plugin #5833
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
Conversation
fc54ab9 to
240710a
Compare
This commit introduces a `nomad` plugin which provides a DNS interface for querying Nomad services. Ref coredns#5829 Signed-off-by: Karan Sharma <[email protected]>
chrisohaver
left a comment
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.
Thanks for contributing!
| m.Rcode = dns.RcodeNameError | ||
| w.WriteMsg(m) | ||
| requestFailedCount.WithLabelValues(metrics.WithServer(ctx), namespace).Inc() | ||
| return dns.RcodeNameError, nil |
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.
RE: double writes: This is OK as is. dns.RcodeNameError is not categorized as a failure.
However, NXDOMAIN responses also require an SOA record returned in the Authority section (Ns).
|
|
||
| // Check the query type to format the appriopriate response. | ||
| switch qtype { | ||
| case dns.TypeA: |
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 think before appending, you need to make sure here that the addr is actually a v4 IP.
ditto for AAAA case.
| return dns.RcodeNotImplemented, nil | ||
| } | ||
| } | ||
|
|
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.
Need to add a check here in the event that there were no matching registrations of the queried type. e.g. if a service has an ipv6 address registered, but no ipv4, and user queried for type A. In this case, we need to add an SOA record to the Authority section of the response, since the sewer will be empty (a "NODATA" response).
|
This pull request is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days |
|
Sorry, lost track of this and got busy. I'll work on changes mentioned soon. |
|
This pull request is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days |
|
@mr-karan Can this get reopened and pushed over the finish line? Having this plugin added to coreDNS would be a fantastic addition. |
|
hey, |
|
@mr-karan, is it ok with you if someone else picks up your proposed code to complete the feature? |
|
I think this would make more sense to start out as an external plugin. |
|
https://github.com/ituoga/coredns-nomad just good enought for now, builds via cd/cd but works with weave.works so good for now. |
|
if you think that something is broken and you have no time, please, tell for "next" (just with comment and PR) what it can do. |
|
you don't have to finish what you started just because you started it. but leave not to next, where to start ;) |
|
This was available as an external plugin since a very long time: https://github.com/mr-karan/coredns-nomad I agree I should have been more proactive/communicative in this thread. Couldn't make/find time to continue with it. Apologies, will do better next time. |
just too long :) do you have time to merge and review PR's? ? so maybe we could move github actions part to your repo? |
|
Sure, please feel free to open a PR. Will get this shipped 🚀 |
|
@mr-karan when do you plan to have this shipped? will be amazing to use it <3 |
|
@caiodelgadonew It's available as immediate use even now: https://github.com/mr-karan/coredns-nomad @blinkinglight is helping with releasing a docker image for this plugin. |
This commit introduces a
nomadplugin which provides a DNS interface for querying Nomad services.1. Why is this pull request needed and what does it do?
This PR adds a
nomadplugin. It provides the capability to query Nomad services API via DNS.2. Which issues (if any) are related?
#5829
3. Which documentation changes (if any) need to be made?
The plugin has a README.md so I believe that is sufficient.
4. Does this introduce a backward incompatible change or deprecation?
No.