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

Add pod annotations/labels for container level hook #165

Merged
merged 1 commit into from
May 24, 2022

Conversation

honpey
Copy link
Contributor

@honpey honpey commented May 23, 2022

Ⅰ. Describe what this PR does

Ⅱ. Does this pull request fix one issue?

Ⅲ. Describe how to verify it

Ⅳ. Special notes for reviews

@koordinator-bot koordinator-bot bot requested review from FillZpp and hormes May 23, 2022 13:02
@honpey honpey force-pushed the runtime-manager-dev branch from d739502 to 84ac1d6 Compare May 23, 2022 13:03
Signed-off-by: pengyang.hpy <honpey@gmail.com>
@honpey honpey force-pushed the runtime-manager-dev branch from 84ac1d6 to 2efddb6 Compare May 23, 2022 13:06
@zwzhang0107
Copy link
Contributor

/lgtm

@codecov-commenter
Copy link

codecov-commenter commented May 23, 2022

Codecov Report

Merging #165 (2efddb6) into main (1d13d60) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #165   +/-   ##
=======================================
  Coverage   57.82%   57.82%           
=======================================
  Files          91       91           
  Lines        8159     8159           
=======================================
  Hits         4718     4718           
  Misses       3029     3029           
  Partials      412      412           
Flag Coverage Δ
unittests 57.82% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1d13d60...2efddb6. Read the comment docs.

@@ -124,6 +124,9 @@ message ContainerResourceHookRequest {
map<string, string> container_annotations = 3;
LinuxContainerResources container_resources = 4;
LinuxContainerResources pod_resources = 5;
// pod related annotations and labels
map<string, string> pod_annotations = 6;
map<string, string> pod_labels = 7;
Copy link
Member

Choose a reason for hiding this comment

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

Why consider putting it at the interface level instead of letting the plugin get it by itself?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why consider putting it at the interface level instead of letting the plugin get it by itself?

where to get pod info for plugin? talk with runtime-manager or containerd?

Copy link
Member

Choose a reason for hiding this comment

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

et. koordlet can get it from it local cache.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

et. koordlet can get it from it local cache.

there may be only PreStartContainerHook registered, so koordlet could not catch pod level annotations/levels during RunSandbox stage without PreRunPodSandboxHook hook.

yet, koordlet can register PreRunPodSandboxHook explicitly to solve, but we had better do not import dependency between two hooks(e.g PreRunPodSandboxHook and PreStartContainerHook).

Copy link
Contributor Author

@honpey honpey May 24, 2022

Choose a reason for hiding this comment

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

et. koordlet can get it from it local cache.

there may be only PreStartContainerHook registered, so koordlet could not catch pod level annotations/levels during RunSandbox stage without PreRunPodSandboxHook hook.

yet, koordlet can register PreRunPodSandboxHook explicitly to solve, but we had better do not import dependency between two hooks(e.g PreRunPodSandboxHook and PreStartContainerHook).

then, koordlet would be stateless, since no need to store the pod info for subsequent hooks

Copy link
Contributor

Choose a reason for hiding this comment

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

1、pod syncing is for metric analysis and dynamic QoS policies, which is asynchronous with hook injections. So the injections will be ineffective if the hook wait

Copy link
Member

Choose a reason for hiding this comment

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

Such as communication, keep these two fields, but let's do some deductions in the early stage(restricted to koordinator.sh)

Copy link
Contributor

Choose a reason for hiding this comment

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

memo:
1、priority class for pod/container req
2、filter with DomainPrefix

Copy link
Member

@jasonliu747 jasonliu747 left a comment

Choose a reason for hiding this comment

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

/lgtm

@hormes
Copy link
Member

hormes commented May 24, 2022

/approve

@koordinator-bot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hormes

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

The pull request process is described 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

@koordinator-bot koordinator-bot bot merged commit e524847 into koordinator-sh:main May 24, 2022
@honpey honpey deleted the runtime-manager-dev branch May 24, 2022 06:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants