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

Avoid initial allocation delay in IPAMFromCloud and IPFromCluster allocator #61123

Closed
satyasm opened this issue Mar 13, 2018 · 1 comment · Fixed by #61124
Closed

Avoid initial allocation delay in IPAMFromCloud and IPFromCluster allocator #61123

satyasm opened this issue Mar 13, 2018 · 1 comment · Fixed by #61124
Labels
kind/bug Categorizes issue or PR as related to a bug. sig/network Categorizes an issue or PR as relevant to SIG Network.

Comments

@satyasm
Copy link
Contributor

satyasm commented Mar 13, 2018

Is this a BUG REPORT or FEATURE REQUEST?:
/kind bug

What happened:
The onAdd handler in ipam/controller.go

	if syncer, ok := c.syncers[node.Name]; !ok {
		syncer = c.newSyncer(node.Name)
		c.syncers[node.Name] = syncer
		go syncer.Loop(nil)
	} else {
		glog.Warningf("Add for node %q that already exists", node.Name)
		syncer.Update(node)
	}

create a new sync instance with it's own loop, but does not actually handle the event itself. This means that the loop code falls back to the delay handler case (https://github.com/kubernetes/kubernetes/blob/master/pkg/controller/nodeipam/ipam/sync/sync.go#L146) in the absence of any new updates seen on this node. This might mean that in the extreme case of no new update events seen for the node after the add, it can take up to 30 seconds for the pod CIDR to be allocated. Granted that in most practical cases, during node addition, other updates would trigger an earlier allocation.

What you expected to happen:
Trigger the syncer.Update code in all cases, including node add events.

How to reproduce it (as minimally and precisely as possible):
Observed as potential delay in pod CIDR allocataion and how long node takes to be fully ready when using IPAMFromCluster or IPAMFromCloud allocators.

Anything else we need to know?:

Environment:

  • Kubernetes version (use kubectl version): 1.9
  • Cloud provider or hardware configuration: GCE
  • OS (e.g. from /etc/os-release): all supported?
  • Kernel (e.g. uname -a): all supported?
  • Install tools: all supported?
  • Others:
@k8s-ci-robot k8s-ci-robot added needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. kind/bug Categorizes issue or PR as related to a bug. labels Mar 13, 2018
@satyasm
Copy link
Contributor Author

satyasm commented Mar 13, 2018

/sig network

@k8s-ci-robot k8s-ci-robot added sig/network Categorizes an issue or PR as relevant to SIG Network. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Mar 13, 2018
satyasm added a commit to satyasm/kubernetes that referenced this issue Mar 13, 2018
k8s-github-robot pushed a commit that referenced this issue Mar 21, 2018
Automatic merge from submit-queue. 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>.

Fix Issue #61123, call syncer.Update on add event.

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

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

**Special notes for your reviewer**:

**Release note**:

```release-note
Fixed #61123 by triggering syncer.Update on all cases including when a syncer is created
on a new add event.
```
satyasm added a commit to satyasm/kubernetes that referenced this issue Apr 2, 2018
prameshj pushed a commit to prameshj/kubernetes that referenced this issue Jun 1, 2018
tossmilestone pushed a commit to tossmilestone/kubernetes that referenced this issue Aug 2, 2018
tossmilestone added a commit to alauda/kubernetes that referenced this issue Aug 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. sig/network Categorizes an issue or PR as relevant to SIG Network.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants