mirror of
https://github.com/weaveworks/scope.git
synced 2026-07-28 01:31:17 +00:00
Merge pull request #3080 from weaveworks/stop-polling-k8s
Remove flag -probe.kubernetes.interval and stop re-syncing Kubernetes data
This commit is contained in:
@@ -48,7 +48,6 @@ type Client interface {
|
||||
|
||||
type client struct {
|
||||
quit chan struct{}
|
||||
resyncPeriod time.Duration
|
||||
client *kubernetes.Clientset
|
||||
podStore cache.Store
|
||||
serviceStore cache.Store
|
||||
@@ -66,7 +65,6 @@ type client struct {
|
||||
|
||||
// ClientConfig establishes the configuration for the kubernetes client
|
||||
type ClientConfig struct {
|
||||
Interval time.Duration
|
||||
CertificateAuthority string
|
||||
ClientCertificate string
|
||||
ClientKey string
|
||||
@@ -129,9 +127,8 @@ func NewClient(config ClientConfig) (Client, error) {
|
||||
}
|
||||
|
||||
result := &client{
|
||||
quit: make(chan struct{}),
|
||||
resyncPeriod: config.Interval,
|
||||
client: c,
|
||||
quit: make(chan struct{}),
|
||||
client: c,
|
||||
}
|
||||
|
||||
result.podStore = NewEventStore(result.triggerPodWatches, cache.MetaNamespaceKeyFunc)
|
||||
@@ -225,7 +222,7 @@ func (c *client) runReflectorUntil(resource string, store cache.Store) {
|
||||
return true, nil
|
||||
}
|
||||
lw := cache.NewListWatchFromClient(kclient, resource, metav1.NamespaceAll, fields.Everything())
|
||||
r = cache.NewReflector(lw, itemType, store, c.resyncPeriod)
|
||||
r = cache.NewReflector(lw, itemType, store, 0)
|
||||
}
|
||||
|
||||
select {
|
||||
|
||||
@@ -303,7 +303,6 @@ func setupFlags(flags *flags) {
|
||||
|
||||
// K8s
|
||||
flag.BoolVar(&flags.probe.kubernetesEnabled, "probe.kubernetes", false, "collect kubernetes-related attributes for containers")
|
||||
flag.DurationVar(&flags.probe.kubernetesClientConfig.Interval, "probe.kubernetes.interval", 10*time.Second, "how often to do a full resync of the kubernetes data")
|
||||
flag.StringVar(&flags.probe.kubernetesClientConfig.Server, "probe.kubernetes.api", "", "The address and port of the Kubernetes API server (deprecated in favor of equivalent probe.kubernetes.server)")
|
||||
flag.StringVar(&flags.probe.kubernetesClientConfig.CertificateAuthority, "probe.kubernetes.certificate-authority", "", "Path to a cert. file for the certificate authority")
|
||||
flag.StringVar(&flags.probe.kubernetesClientConfig.ClientCertificate, "probe.kubernetes.client-certificate", "", "Path to a client certificate file for TLS")
|
||||
|
||||
Reference in New Issue
Block a user