AliyunContainerService / kube-eventer

kube-eventer emit kubernetes events to sinks
Apache License 2.0
1.01k stars 278 forks source link

--source=和--sink=后面怎么一次性加多个源? #247

Closed wgngoo closed 1 year ago

wgngoo commented 2 years ago
wolgod commented 2 years ago

i also want‘t to know

wanggithub08 commented 2 years ago

sink应该是数组,亲测多个sink好使

Shuimo03 commented 1 year ago

可以看下初始化这一段代码: kube-eventer/eventer.go

var (
    argFrequency    = flag.Duration("frequency", 30*time.Second, "The resolution at which Eventer pushes events to sinks")
    argMaxProcs     = flag.Int("max_procs", 0, "max number of CPUs that can be used simultaneously. Less than 1 for default (number of cores)")
    argSources      flags.Uris
    argSinks        flags.Uris
    argVersion      bool
    argEventMetrics bool
    argHealthzIP    = flag.String("healthz-ip", "0.0.0.0", "ip eventer health check service uses")
    argHealthzPort  = flag.Uint("healthz-port", 8084, "port eventer health check listens on")
)

flag.Var(&argSources, "source", "source(s) to read events from")
    flag.Var(&argSinks, "sink", "external sink(s) that receive events")
    flag.BoolVar(&argVersion, "version", false, "print version info and exit")
    flag.BoolVar(&argEventMetrics, "event-metrics", true, "whether to collect and export event metrics")
    flag.Parse()

uri都是slice,所以是可以添加多个source和sinks