-
Notifications
You must be signed in to change notification settings - Fork 3
Enable CoreDNS in nodeup/protokube #6
Enable CoreDNS in nodeup/protokube #6
Conversation
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.
If you know, can you please point out the code where the master's dns configuration is being updated in nodeup or protokube code?
@@ -95,7 +96,7 @@ func main() { | |||
os.Exit(1) | |||
} | |||
|
|||
dnsController, err := dns.NewDNSController(dnsProvider, zoneRules) | |||
dnsController, err := dns.NewDNSController(dnsProvider, zoneRules, dnsProviderId) |
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 am not able to put a comment on line#49, can you please add coredns in the string message.
Also, can you please share what value will this dnsProviderId will carry?
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.
This is decided by the --dns flags inside DAEMON_ARGS. So it's setting to coredns at here: https://github.com/vmware/kops/pull/6/files/6326f161619435794c37157b7ef7c79db636ea1b#diff-b25ed23c3990586a8ed6e64c73bb178cR276
} | ||
} else { |
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.
Nit: Adding a comment that aws route53 and gce's clouddns will get executed by else-block would be helpful here and at other similar places in code.
@@ -423,6 +428,30 @@ func (o *dnsOp) deleteRecords(k recordKey) error { | |||
return fmt.Errorf("no suitable zone found for %q", fqdn) | |||
} | |||
|
|||
if dnsProviderId == k8scoredns.ProviderName { | |||
// TODO: work-around before ResourceRecordSets.List() is implemented for CoreDNS |
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.
Nit: moving this comment on top of if-block will make it clearer that the whole if-block is part of the work-around.
lines = append(lines, "etcd-endpoints = "+dnsServer) | ||
lines = append(lines, "zones = "+zones[0]) | ||
config := "[global]\n" + strings.Join(lines, "\n") + "\n" | ||
file = bytes.NewReader([]byte(config)) |
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.
Can you please explain the role of this config file?
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.
AWS or GCE's DNS server doesn't need any specific information because they have public server address to access. But to use CoreDNS, we need to pass information about the IP address of the CoreDNS's etcd and zones to query. These are required to start a CoreDNS client. And this config file (it's not a real file though) is used to pass in these information. Without this config file, the DNS provider won't know which CoreDNS server to talk to.
@prashima I think it's done inside this dnscontroller.go too. Need to verify it. |
d1b45e9
to
21a4abe
Compare
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.
LGTM.
Please run make push-sphere to make sure protokube and nodeup are getting built successfully.
21a4abe
to
734650f
Compare
* Enable CoreDNS in nodeup/protokube. * Address comments.
* Enable CoreDNS in nodeup/protokube. * Address comments.
* Enable CoreDNS in nodeup/protokube. * Address comments.
* Enable CoreDNS in nodeup/protokube. * Address comments.
* Enable CoreDNS in nodeup/protokube. * Address comments.
Added a few branches since ResourceRecordSets.List() of CoreDNS is not available.