-
Notifications
You must be signed in to change notification settings - Fork 4.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
Gossip backed DNS #2327
Gossip backed DNS #2327
Conversation
4d746a2
to
51f2012
Compare
0b62938
to
bb74fc8
Compare
8f65c12
to
685cda0
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.
Looks awesome. How are we testing this? Can we set the timeout? Is dnscontroller the right place for this? I am wondering if we want a seperate controller. Just thinking to the future when we replace dnscontroller.... if we do.
"k8s.io/kubernetes/federation/pkg/dnsprovider/rrstype" | ||
) | ||
|
||
const defaultTTL = 60 |
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.
Is this 60 seconds?
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.
It is below... it is seconds. Can we override?
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.
We have to return something, so we use 1 minute. There are no TTLs in /etc/hosts
So far I've tested this manually i.e. by bringing up a cluster. dnscontroller is a client of dnsprovider, and we have a new dnsprovider that talks to the gossip state. We could use the same dnsprovider with external-dns. The writing to /etc/hosts is done by protokube. It also writes a few hosts to the gossip state. I'll rebase :-) |
Plan for real testing is to test GCE using this, without needing a DNS name |
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.
More questions.. This is a MONDO PR. I need some more time to process and re-read again.
|
||
id := os.Getenv("HOSTNAME") | ||
if id == "" { | ||
glog.Warningf("Unable to fetch HOSTNAME for use as node identifier") |
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.
Is this a warning or a failure?
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.
Apparently a warning :-)
@@ -190,6 +191,11 @@ func (b *KubeProxyBuilder) buildPod() (*v1.Pod, error) { | |||
sslCertsHost.MountPath = "/etc/ssl/certs" | |||
} | |||
|
|||
if dns.IsGossipHostname(b.Cluster.Name) { | |||
// Map /etc/hosts from host, so that we see the updates that are made by protokube | |||
addHostPathMapping(pod, container, "etchosts", "/etc/hosts") |
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.
Are we adding a comment to /etc/hosts
that we are maintaining it? I am not sure if we are adding comments to all of the files we have. This would be an issue that I would file as a separate enhancement.
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.
Yes we do add a comment
protokube/pkg/gossip/dns/dns.go
Outdated
Records map[string]DNSRecord | ||
} | ||
|
||
func (s *DNSViewSnapshot) RecordsForZone(zoneInfo DNSZoneInfo) []DNSRecord { |
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.
Code comment ...pretty please
I will need to take a third pass ... |
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.
Question about documentation :)
## DNS | ||
|
||
* We implement a dnsprovider backed by our local gossip state | ||
* We write to `/etc/hosts`; this is sort of hacky but avoids the need for a custom local resolver |
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.
How do we launch this? How do we debug this? Do we have other user documentation?
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.
Use a .k8s.local internal name; you'll also need to use api: loadBalancer: {}
as we need a way for kubelet to reach apiserver. More docs to follow once it is more baked.
Let me see if I can fork this and test in GCE next week :) |
I'll fix the 2 problems @chrislovecnm |
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.
awesomesauce
Checklist:
This change is