Merge pull request #51777 from m1093782566/ipvs-sync-period

Automatic merge from submit-queue (batch tested with PRs 52240, 48145, 52220, 51698, 51777). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>..

Add ipvs default sync period

**What this PR does / why we need it**:

If sync period <=0, it will cause kube-proxy panic, see: https://github.com/kubernetes/kubernetes/blob/master/pkg/proxy/ipvs/proxier.go#L728

That is, the input parameter for `time.NewTicker()` must be >0.

Unfortunately, current default value of sync period is 0.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
pull/6/head
Kubernetes Submit Queue 2017-09-23 09:14:05 -07:00 committed by GitHub
commit 1c0c83d245
1 changed files with 3 additions and 0 deletions

View File

@ -72,6 +72,9 @@ func SetDefaults_KubeProxyConfiguration(obj *KubeProxyConfiguration) {
if obj.IPTables.SyncPeriod.Duration == 0 {
obj.IPTables.SyncPeriod = metav1.Duration{Duration: 30 * time.Second}
}
if obj.IPVS.SyncPeriod.Duration == 0 {
obj.IPVS.SyncPeriod = metav1.Duration{Duration: 30 * time.Second}
}
zero := metav1.Duration{}
if obj.UDPIdleTimeout == zero {
obj.UDPIdleTimeout = metav1.Duration{Duration: 250 * time.Millisecond}