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

feature: support pod skip runtime hook with specified label #682

Merged
merged 1 commit into from
Nov 1, 2022

Conversation

ZYecho
Copy link
Contributor

@ZYecho ZYecho commented Oct 9, 2022

Signed-off-by: Yue Zhang huaihuan.zy@alibaba-inc.com

Ⅰ. Describe what this PR does

fix #670

Ⅱ. Does this pull request fix one issue?

Ⅲ. Describe how to verify it

Ⅳ. Special notes for reviews

V. Checklist

  • I have written necessary docs and comments
  • I have added necessary unit tests and integration tests
  • All checks passed in make test

@codecov
Copy link

codecov bot commented Oct 9, 2022

Codecov Report

Base: 68.43% // Head: 68.45% // Increases project coverage by +0.02% 🎉

Coverage data is based on head (3be6f63) compared to base (0a4d099).
Patch coverage: 36.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #682      +/-   ##
==========================================
+ Coverage   68.43%   68.45%   +0.02%     
==========================================
  Files         208      208              
  Lines       24002    24011       +9     
==========================================
+ Hits        16425    16437      +12     
+ Misses       6432     6429       -3     
  Partials     1145     1145              
Flag Coverage Δ
unittests 68.45% <36.00%> (+0.02%) ⬆️

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

Impacted Files Coverage Δ
pkg/runtimeproxy/resexecutor/cri/container.go 70.00% <0.00%> (ø)
pkg/runtimeproxy/server/docker/handler.go 36.65% <25.00%> (-0.13%) ⬇️
pkg/runtimeproxy/resexecutor/cri/pod.go 72.54% <100.00%> (ø)
pkg/runtimeproxy/resexecutor/cri/utils.go 87.90% <100.00%> (ø)
pkg/koordlet/runtimehooks/reconciler/reconciler.go 81.05% <0.00%> (+9.47%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@ZYecho
Copy link
Contributor Author

ZYecho commented Oct 9, 2022

also need to update charts of koordlet

@hormes hormes requested review from zwzhang0107 and removed request for FillZpp October 12, 2022 04:37
@hormes
Copy link
Member

hormes commented Oct 13, 2022

what about the containerd part?

cfgBody.HostConfig = UpdateHostConfigByResource(cfgBody.HostConfig, resp.ContainerResources)
containerInfo.ContainerResources = resp.ContainerResources
if !types.SkipRuntimeHook(podInfo.Labels) {
hookResp, err := d.dispatcher.Dispatch(ctx, runtimeHookPath, config.PreHook, hookReq)
Copy link
Contributor

@honpey honpey Oct 27, 2022

Choose a reason for hiding this comment

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

why not setting config.NoneRuntimeHookPath to hint skipping, just like HandleUpdateContainer/HandleStopContainer part? which may lead to less changes.

Copy link
Contributor

Choose a reason for hiding this comment

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

+1

@@ -26,10 +26,19 @@ const (
ContainerTypeLabelSandbox = "podsandbox"
ContainerTypeLabelContainer = "container"
SandboxIDLabelKey = "io.kubernetes.sandbox.id"

RuntimeProxySkipLabelKey = "node.koordinator.sh/skip-runtime-hook"
Copy link
Contributor

Choose a reason for hiding this comment

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

remember to unified the naming with cri

@ZYecho ZYecho force-pushed the support-fail-config branch 2 times, most recently from 5945433 to 4b722ac Compare October 28, 2022 03:42
)

const (
ContainerTypeLabelKey = "io.kubernetes.docker.type"
ContainerTypeLabelSandbox = "podsandbox"
ContainerTypeLabelContainer = "container"
SandboxIDLabelKey = "io.kubernetes.sandbox.id"

RuntimeProxySkipLabelKey = "runtimeproxy.koordinator.sh/is-hookserver"
Copy link
Member

Choose a reason for hiding this comment

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

I think this mechanism should not be strongly bound to the hook server. All pods that need skip can follow this special protocol.

so node.koordinator.sh/skip-hookserver may be better.

@ZYecho ZYecho force-pushed the support-fail-config branch 2 times, most recently from e2e0256 to e2b24a5 Compare November 1, 2022 11:34
Signed-off-by: Yue Zhang <huaihuan.zy@alibaba-inc.com>
@honpey
Copy link
Contributor

honpey commented Nov 1, 2022

/lgtm

@koordinator-bot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

Approval requirements bypassed by manually added approval.

This pull-request has been approved by:

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 bee4f1d into koordinator-sh:main Nov 1, 2022
@ZYecho ZYecho deleted the support-fail-config branch November 2, 2022 02:25
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.

[BUG] pods with specified label should be ignored by koord-runtime-proxy for containerd/docker
4 participants