mirror of
https://github.com/weaveworks/scope.git
synced 2026-03-03 18:20:27 +00:00
Add --probe.ecs flag to enable running the ECS probe tagger
This commit is contained in:
@@ -104,6 +104,8 @@ type probeFlags struct {
|
||||
kubernetesEnabled bool
|
||||
kubernetesConfig kubernetes.ClientConfig
|
||||
|
||||
ecsEnabled bool
|
||||
|
||||
weaveEnabled bool
|
||||
weaveAddr string
|
||||
weaveHostname string
|
||||
@@ -282,6 +284,9 @@ func main() {
|
||||
flag.StringVar(&flags.probe.kubernetesConfig.User, "probe.kubernetes.user", "", "The name of the kubeconfig user to use")
|
||||
flag.StringVar(&flags.probe.kubernetesConfig.Username, "probe.kubernetes.username", "", "Username for basic authentication to the API server")
|
||||
|
||||
// AWS ECS
|
||||
flag.BoolVar(&flags.probe.ecsEnabled, "probe.ecs", false, "collect ecs-related attributes for containers on this node")
|
||||
|
||||
// Weave
|
||||
flag.StringVar(&flags.probe.weaveAddr, "probe.weave.addr", "127.0.0.1:6784", "IP address & port of the Weave router")
|
||||
flag.StringVar(&flags.probe.weaveHostname, "probe.weave.hostname", app.DefaultHostname, "Hostname to lookup in WeaveDNS")
|
||||
|
||||
@@ -23,6 +23,7 @@ import (
|
||||
"github.com/weaveworks/scope/common/xfer"
|
||||
"github.com/weaveworks/scope/probe"
|
||||
"github.com/weaveworks/scope/probe/appclient"
|
||||
"github.com/weaveworks/scope/probe/awsecs"
|
||||
"github.com/weaveworks/scope/probe/controls"
|
||||
"github.com/weaveworks/scope/probe/docker"
|
||||
"github.com/weaveworks/scope/probe/endpoint"
|
||||
@@ -201,6 +202,10 @@ func probeMain(flags probeFlags, targets []appclient.Target) {
|
||||
}
|
||||
}
|
||||
|
||||
if flags.ecsEnabled {
|
||||
p.AddTagger(awsecs.Reporter{})
|
||||
}
|
||||
|
||||
if flags.weaveEnabled {
|
||||
client := weave.NewClient(sanitize.URL("http://", 6784, "")(flags.weaveAddr))
|
||||
weave, err := overlay.NewWeave(hostID, client, dockerEndpoint)
|
||||
|
||||
Reference in New Issue
Block a user