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

Enable DNS for services #2224

Merged
merged 7 commits into from
Dec 29, 2014
Merged

Enable DNS for services #2224

merged 7 commits into from
Dec 29, 2014

Conversation

thockin
Copy link
Member

@thockin thockin commented Nov 7, 2014

Open issues as of 11/15

Needs e2e testing

Question: Can services exist above "default"? I.e. do we need to search (domain) and (ns).(domain) or just (ns).(domain) ?

Should default.(domain) be in everyone's search list?

TODO: plumb DNS to minion's resolv.conf for use from host

TODO: fix portals for UDP from host (works from a container)

  • source address is wrong on response from host:
    OUTPUT -> -A KUBE-PROXY-LOCAL -d 10.0.0.10/32 -p udp -m comment --comment skydns -m udp --dport 53 -j DNAT --to-destination 10.240.239.33:41504

TODO: Need a specific version tag on the skydns, kube2sky, and etcd containers.

Addresses #1261.

@derekwaynecarr
Copy link
Member

LGTM

@@ -35,4 +35,16 @@ kube-up

"${KUBE_ROOT}/cluster/validate-cluster.sh"

if [[ "${ENABLE_DNS}" == "y" ]]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this looks workable. As we get more of these we should think about (a) using namespaces and (b) having a directory that is 'services-enabled' similar to how apache/nginx work. We'd rip through those and do a 'kubectl create' for each of those.

@jbeda
Copy link
Contributor

jbeda commented Nov 7, 2014

We probably want an e2e test that makes sure this continues to work? Do you want to get that in with this PR or should we get it in in a future one?

@thockin
Copy link
Member Author

thockin commented Nov 7, 2014

I will have an e2e test when all the plumbing is done. As it is, this is a
useless PR, and I could hold off on commit.

Agree 100% that we need a plugin-like system for turning these one. Just
discussing this side-band. We have at least 3 or 4 such things:

DNS has: "run a pod", "configure node resolv.conf", and "configure docker
daemon" aspects
logging has: "run an agent on every machine" and "run a pod in the cluster"
components
heapster has: "run a pod in the cluster" aspects (and per-node, but we just
defaulted that already)
docker-registry has: "run a pod" and "configure docker daemon" aspects

On Fri, Nov 7, 2014 at 9:59 AM, Joe Beda notifications@github.com wrote:

We probably want an e2e test that makes sure this continues to work? Do
you want to get that in with this PR or should we get it in in a future one?

Reply to this email directly or view it on GitHub
#2224 (comment)
.

@jbeda
Copy link
Contributor

jbeda commented Nov 7, 2014

I'll hold off util more of it is there.

@brendandburns
Copy link
Contributor

I can haz rebase? Then you can haz mergez ;)

@thockin
Copy link
Member Author

thockin commented Nov 11, 2014

No point merging this until a few other pieces fall into place. I'll be
working on this off and on the rest of this week, on planes and such. I
know how to do the rest and I have a TODO list.

On Mon, Nov 10, 2014 at 9:19 PM, Brendan Burns notifications@github.com
wrote:

I can haz rebase? Then you can haz mergez ;)

Reply to this email directly or view it on GitHub
#2224 (comment)
.

@thockin thockin force-pushed the dns branch 2 times, most recently from a3d1787 to e39eca0 Compare November 16, 2014 05:53
@thockin thockin changed the title Make DNS an option for cluster turnup Enable DNS for services Nov 16, 2014
@thockin
Copy link
Member Author

thockin commented Nov 16, 2014

I have re-titled this and added some comments about work in progress. This is far enough along to warrant some review. It may even be good enough to go in soon.

@derekwaynecarr
@lavalamp
@bketelsen

helper container called `kube2sky` also runs in the pod and acts a bridge
between Kubernetes and SkyDNS. It finds the Kubernetes master through the
`kubernetes-ro` service, pulls service info from it, and write that to etcd for
SkyDNS to find.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it finds.., it pulls..., and writes that

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@thockin thockin force-pushed the dns branch 2 times, most recently from 85039c4 to 332f976 Compare November 17, 2014 05:25
@@ -739,6 +739,8 @@ type ContainerManifest struct {
Volumes []Volume `yaml:"volumes" json:"volumes"`
Containers []Container `yaml:"containers" json:"containers"`
RestartPolicy RestartPolicy `json:"restartPolicy,omitempty" yaml:"restartPolicy,omitempty"`
// Optional: Disable cluster-local DNS. Defaults to false.
DisableClusterDNS bool `json:"disableClusterDNS" yaml:"disableClusterDNS"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we not name options in the negative?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the use case for this option, anyway?

Should the option be about publishing in general, instead of about DNS specifically?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh. I see from the kubelet code that this option is about giving the pod access to cluster DNS, not about not publishing the pod. Maybe the name can be improved. Doubly unsure about the use case now, though.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would much rather name this "EnableClusterDNS" and default to true, but the way we do defaulting, I can not tell if the user set it to False or expected the default.

This exists primarily so that SkyDNS does not try to use itself for DNS lookups. Maybe we don't NEED it (would have to try), but it feels scary to have this self-loop.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then make it an enum, DNS, with the values "clusterProvided" and "defaultExternal". That's better than a bool in any case, gives us more flexibility later.

Use case sounds... surprisingly valid, OK.

@lavalamp
Copy link
Member

LGTM with api change from bool->enum.

@thockin thockin force-pushed the dns branch 2 times, most recently from dd723b0 to aecf766 Compare November 20, 2014 03:42
@thockin
Copy link
Member Author

thockin commented Nov 20, 2014

New push is up. I have not properly tested it by spinning up a whole cluster - will do that ASAP.

@derekwaynecarr
Copy link
Member

@thockin - I will look to spin up a vagrant cluster and report back.

@derekwaynecarr
Copy link
Member

@thockin - can you rebase this? right now, i cant bring up the cluster in this branch because of bug fixes that have since been fixed.

@lavalamp
Copy link
Member

LGTM will merge on green

@thockin
Copy link
Member Author

thockin commented Dec 24, 2014

I think all comments are addressed. Re-running e2e.

@lavalamp
Copy link
Member

Did e2e pass?

@lavalamp lavalamp added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 24, 2014
@thockin
Copy link
Member Author

thockin commented Dec 24, 2014

e2e passed several times, but I saw it flake once. Will retry and see if I can figure it out.

This adds --cluster_dns and --cluster_domain flags to kubelet.  If
non-empty, kubelet will set docker --dns and --dns-search flags based on
these.  It uses the cluster DNS and appends the hosts's DNS servers.
Likewise for DNS search domains.

This also adds API support to bypass cluster DNS entirely, needed to
bootstrap DNS.
Rather than have to keep SkyDNS up to date with Kubernetes, use a
buddy-container "kube2sky" to watch kubernetes and sync Service records
into etcd for SkyDNS ot find.  This also adds namespace support.
After this DNS is resolvable from the host, if the DNS server is targetted
explicitly.  This does NOT add the cluster DNS to the host's resolv.conf.  That
is a larger problem, with distro-specific tie-ins and circular deps.
@thockin
Copy link
Member Author

thockin commented Dec 29, 2014

I re-ran e2e dozens of times (including setup and teardown) and could not get it to flake. I think we should commit this.

@jbeda (oncall)

jbeda added a commit that referenced this pull request Dec 29, 2014
Enable DNS for services
@jbeda jbeda merged commit a2e58d4 into kubernetes:master Dec 29, 2014
@thockin
Copy link
Member Author

thockin commented Dec 29, 2014

w00t!!

On Mon, Dec 29, 2014 at 10:28 AM, Joe Beda notifications@github.com wrote:

Merged #2224 #2224
.

Reply to this email directly or view it on GitHub
#2224 (comment)
.

@lavalamp
Copy link
Member

Yay!

@bgrant0607
Copy link
Member

Awesome!

@brendandburns
Copy link
Contributor

Cool!
On Dec 29, 2014 11:21 AM, "bgrant0607" notifications@github.com wrote:

Awesome!


Reply to this email directly or view it on GitHub
#2224 (comment)
.

@thockin thockin deleted the dns branch January 12, 2015 14:21
seans3 pushed a commit to seans3/kubernetes that referenced this pull request Apr 10, 2019
SIG Cloud Provider KEP: Reporting Conformance Test Results to Testgrid
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Elno5, thockin
Once this PR has been reviewed and has the lgtm label, please assign liggitt for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm "Looks good to me", indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.