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

bugfix: list runtimeclass and csidriver from cache error when cloud-edge network disconnected #258

Merged
merged 1 commit into from
Apr 19, 2021

Conversation

rambohe-ch
Copy link
Member

Ⅰ. Describe what this PR does

  • background:
  1. At present, we use component/resource/namespace/name as file path to store response objects from kube-apiserver on local disk.
  2. If response objects from kube-apiserver are empty(like kubelet list runtimeclass, csidriver), cache info will not be created on local disk.
  3. when cloud-edge network becomes disconnected, kubelet will list runtimeclass, csidriver from local disk cache, and yurthub return 404 to kubele. so kubelet will re-list runtimeclass and csidriver frequently.
  • solution:
  1. if response objects from kube-apiserver are empty(like kubelet list runtimeclass, csidriver), yurthub can create key info component/resource in local disk with nil data.
  2. so when kubelet list runtimeclass, csidriver from local disk cache, yurthub will return empty list to kubelet.
  3. and when pods cache data on local disk is deleted by accident, yurthub will return 404 error(not empty list) to kubelet in order to prevent killing pods on node.

Ⅱ. Does this pull request fix one issue?

Ⅲ. List the added test cases (unit test/integration test) if any, please explain if no tests are needed.

=== RUN TestCacheResponseForList/cache_response_for_list_nodes_with_fieldselector
=== RUN TestCacheResponseForList/cache_response_for_list_runtimeclasses_with_no_objects
=== RUN TestCreate/create_dir_key_with_no_data
=== RUN TestCreate/create_dir_key_that_already_exists

Ⅳ. Describe how to verify it

make all
and make sure when cloud-edge networ disconnected, kubelet list runtimeclass and no error has happened.

Ⅴ. Special notes for reviews

@rambohe-ch rambohe-ch changed the title bugfix: list runtimeclass and csidriver error from cache when cloud-edge network disconnected bugfix: list runtimeclass and csidriver from cache error when cloud-edge network disconnected Apr 13, 2021
@rambohe-ch rambohe-ch force-pushed the fix-list-cache-error branch 2 times, most recently from db4ca97 to 019e115 Compare April 19, 2021 05:51
@rambohe-ch rambohe-ch force-pushed the fix-list-cache-error branch from 019e115 to ac4fb4a Compare April 19, 2021 05:59
@Fei-Guo Fei-Guo merged commit 00a37bc into openyurtio:master Apr 19, 2021
@rambohe-ch rambohe-ch deleted the fix-list-cache-error branch May 27, 2021 06:26
MrGirl pushed a commit to MrGirl/openyurt that referenced this pull request Mar 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants