Skip to content

Commit

Permalink
Merge pull request #1433 from weaveworks/1373-kube-dns
Browse files Browse the repository at this point in the history
Have probe query kube dns to find the app.
  • Loading branch information
tomwilkie committed May 5, 2016
2 parents 447bfe2 + 9b8f8a6 commit fc60b93
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions probe/appclient/resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ func (r staticResolver) resolveOne(t target) []string {
var err error
addrs, err = r.lookup(t.host)
if err != nil {
log.Debugf("Error resolving %s: %v", t.host, err)
return []string{}
}
}
Expand Down
2 changes: 2 additions & 0 deletions prog/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ type probeFlags struct {
insecure bool
logPrefix string
logLevel string
resolver string

dockerEnabled bool
dockerInterval time.Duration
Expand Down Expand Up @@ -132,6 +133,7 @@ func main() {
flag.StringVar(&flags.probe.pluginsRoot, "probe.plugins.root", "/var/run/scope/plugins", "Root directory to search for plugins")
flag.BoolVar(&flags.probe.useConntrack, "probe.conntrack", true, "also use conntrack to track connections")
flag.BoolVar(&flags.probe.insecure, "probe.insecure", false, "(SSL) explicitly allow \"insecure\" SSL connections and transfers")
flag.StringVar(&flags.probe.resolver, "probe.resolver", "", "IP address & port of resolver to use. Default is to use system resolver.")
flag.StringVar(&flags.probe.logPrefix, "probe.log.prefix", "<probe>", "prefix for each log line")
flag.StringVar(&flags.probe.logLevel, "probe.log.level", "info", "logging threshold level: debug|info|warn|error|fatal|panic")
flag.BoolVar(&flags.probe.dockerEnabled, "probe.docker", false, "collect Docker-related attributes for processes")
Expand Down
6 changes: 5 additions & 1 deletion prog/probe.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,11 @@ func probeMain(flags probeFlags) {
})
defer clients.Stop()

resolver := appclient.NewResolver(targets, net.LookupIP, clients.Set)
dnsLookupFn := net.LookupIP
if flags.resolver != "" {
dnsLookupFn = appclient.LookupUsing(flags.resolver)
}
resolver := appclient.NewResolver(targets, dnsLookupFn, clients.Set)
defer resolver.Stop()

processCache := process.NewCachingWalker(process.NewWalker(flags.procRoot))
Expand Down

0 comments on commit fc60b93

Please sign in to comment.