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

pool-coordinator implementation of yurthub #1073

Merged
merged 22 commits into from
Dec 7, 2022

Conversation

Congrool
Copy link
Member

@Congrool Congrool commented Nov 23, 2022

What type of PR is this?

/kind feature

What this PR does / why we need it:

Yurthub portion of pool-coordinator implementation, which includes the following functions:

  1. sync pool-scoped resources(currently endpointslices and endpoints) to pool-coordinator
  2. send portion of local cache(currently pods and nodes) to pool-coordinator
  3. proxy heartbeat(kube-node-lease) to cloud site for follower yurthubs when their connections to cloud have broken
  4. cache responses of requests to pool-coordinator which ask the cloud for pool-scoped resources
  5. proxy requests to pool-coordinator when follower yurthub offline

Which issue(s) this PR fixes:

Fixes #778

Special notes for your reviewer:

Does this PR introduce a user-facing change?


other Note

@openyurt-bot
Copy link
Collaborator

@Congrool: GitHub didn't allow me to assign the following users: your_reviewer.

Note that only openyurtio members, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time.
For more information please see the contributor guide

In response to this:

What type of PR is this?

/kind feature

What this PR does / why we need it:

Yurthub portion of pool-coordinator implementation, which includes the following functions:

  1. sync pool-scoped resources(currently endpointslices and endpoints) to pool-coordinator
  2. send portion of local cache(currently pods and nodes) to pool-coordinator
  3. proxy kube-node-lease for follower yurthubs to cloud site
  4. cache responses of requests to pool-coordinator which ask the cloud for pool-scoped resources
  5. proxy requests to pool-coordinator when follower yurthub offline

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?


other Note

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openyurt-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Congrool
To complete the pull request process, please assign kadisi
You can assign the PR to them by writing /assign @kadisi in a comment when ready.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@Congrool
Copy link
Member Author

The implementation currently has not been tested.

values := make([][]byte, 0, len(getResp.Kvs))
for _, kv := range getResp.Kvs {
values = append(values, kv.Value)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line 275~277 should be as following:

for i, kv := range getResp.Kvs {
	values[i] = append(values[i], kv.Value...)
}

if time.Now().After(renewTime.Add(defaultPoolCacheStaleDuration)) {
coordinator.Lock()
defer coordinator.Unlock()
coordinator.isPoolCacheSynced = false
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

coordinator.isPoolCacheSynced = true?

@Congrool
Copy link
Member Author

fixes #778 , need to link it

@rambohe-ch
Copy link
Member

fixes #778 , need to link it

@Congrool done

@Congrool
Copy link
Member Author

Congrool commented Dec 1, 2022

TODO List:

  • Distinguish where logs/exec request is from, Cloud APIServer or Coodinator.
  • Need a way to record the watch request, and return err when proxy handler switch happens. To avoid using rv of pool-coordinator to list/watch cloud apiserver or vise versa.
  • Need a GracePeriod to tolerate pool-coordinator being unavailable for a short period.

Test:

  • Automatically setup etcd before running etcd storage test
  • Test for Coordinator component.
  • New unit tests to cover the logic of Proxy and CacheResponse

@rambohe-ch
Copy link
Member

@Congrool I will merge this pull request for integration test, and you can complete works in the todo list when making integration test.

…ool when pool coordinator becomes ready

Signed-off-by: Congrool <[email protected]>
@Congrool
Copy link
Member Author

Congrool commented Dec 7, 2022

OK, please go ahead @rambohe-ch

@rambohe-ch rambohe-ch merged commit 61b6716 into openyurtio:pool-coordinator-dev Dec 7, 2022
Congrool added a commit to Congrool/openyurt that referenced this pull request Jan 17, 2023
* pool-coordinator implementation of yurthub

Signed-off-by: Congrool <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants