Skip to content

Commit

Permalink
Feat: add 5min resync in logconfig and kube informer
Browse files Browse the repository at this point in the history
  • Loading branch information
ethfoo committed Mar 15, 2024
1 parent ab29042 commit 750de04
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/discovery/kubernetes/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import (
"k8s.io/client-go/tools/cache"
"k8s.io/client-go/tools/clientcmd"
"strings"
"time"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
kubeinformers "k8s.io/client-go/informers"
Expand Down Expand Up @@ -98,9 +99,9 @@ func (d *Discovery) Start(stopCh <-chan struct{}) {
log.Panic("Error building logConf clientset: %s", err.Error())
}

logConfInformerFactory := logconfigInformer.NewSharedInformerFactory(logConfigClient, 0)
logConfInformerFactory := logconfigInformer.NewSharedInformerFactory(logConfigClient, 5*time.Minute)

kubeInformerFactory := kubeinformers.NewSharedInformerFactoryWithOptions(kubeClient, 0, kubeinformers.WithTweakListOptions(func(lo *metav1.ListOptions) {
kubeInformerFactory := kubeinformers.NewSharedInformerFactoryWithOptions(kubeClient, 5*time.Minute, kubeinformers.WithTweakListOptions(func(lo *metav1.ListOptions) {
lo.FieldSelector = fields.OneTermEqualSelector("spec.nodeName", d.config.NodeName).String()
}))

Expand Down

0 comments on commit 750de04

Please sign in to comment.