move repair loop interval to a constant

use Extraconfig to configure the repair interval

and add an integration test for services finalizers, and
possible races with the services repair loop.
This commit is contained in:
Antonio Ojea
2021-06-17 18:17:50 +02:00
committed by Antonio Ojea
parent dcfe8f5d5c
commit 7c12daed0f
4 changed files with 176 additions and 3 deletions

View File

@@ -120,6 +120,8 @@ const (
KubeAPIServer = "kube-apiserver"
// KubeAPIServerIdentityLeaseLabelSelector selects kube-apiserver identity leases
KubeAPIServerIdentityLeaseLabelSelector = IdentityLeaseComponentLabelKey + "=" + KubeAPIServer
// repairLoopInterval defines the interval used to run the Services ClusterIP and NodePort repair loops
repairLoopInterval = 3 * time.Minute
)
// ExtraConfig defines extra configuration for the master
@@ -199,6 +201,10 @@ type ExtraConfig struct {
IdentityLeaseDurationSeconds int
IdentityLeaseRenewIntervalSeconds int
// RepairServicesInterval interval used by the repair loops for
// the Services NodePort and ClusterIP resources
RepairServicesInterval time.Duration
}
// Config defines configuration for the master
@@ -322,6 +328,10 @@ func (c *Config) Complete() CompletedConfig {
cfg.ExtraConfig.EndpointReconcilerConfig.Reconciler = c.createEndpointReconciler()
}
if cfg.ExtraConfig.RepairServicesInterval == 0 {
cfg.ExtraConfig.RepairServicesInterval = repairLoopInterval
}
return CompletedConfig{&cfg}
}