Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make ResyncDuration Configurable #80

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ var (
kubeAPIBurst int
// TApp sync worker number
worker int
//informer ResyncDuration
resync int

// Admission related config
registerAdmission bool
Expand All @@ -80,6 +82,7 @@ var (

const (
defaultWorkerNumber = 5
defaultResync = 30
defaultKubeAPIQPS = 2000
defaultKubeAPIBurst = 2500
)
Expand Down Expand Up @@ -107,8 +110,8 @@ func main() {
klog.Fatalf("Error instantiating apiextensions client: %s", err.Error())
}

kubeInformerFactory := kubeinformers.NewSharedInformerFactory(kubeClient, time.Second*30)
tappInformerFactory := informers.NewSharedInformerFactory(tappClient, time.Second*30)
kubeInformerFactory := kubeinformers.NewSharedInformerFactory(kubeClient, time.Second*time.Duration(resync))
tappInformerFactory := informers.NewSharedInformerFactory(tappClient, time.Second*time.Duration(resync))

controller := tapp.NewController(kubeClient, tappClient, kubeInformerFactory, tappInformerFactory)
run := func(ctx context.Context) {
Expand Down Expand Up @@ -198,6 +201,7 @@ func addFlags(fs *pflag.FlagSet) {
fs.Float32Var(&kubeAPIQPS, "kube-api-qps", defaultKubeAPIQPS, "QPS to use while talking with kubernetes apiserver")
fs.IntVar(&kubeAPIBurst, "kube-api-burst", defaultKubeAPIBurst, "Burst to use while talking with kubernetes apiserver")
fs.IntVar(&worker, "worker", defaultWorkerNumber, "TApp sync worker number, default: 5")
fs.IntVar(&resync, "resync", defaultResync, "informer ResyncDuration , default: 30")

// Admission related
fs.BoolVar(&registerAdmission, "register-admission", false, "Register admission for tapp controller")
Expand Down