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

networkchaos: support select different interface in networkchaos #2290

Merged
merged 15 commits into from
Oct 25, 2021

Conversation

YangKeao
Copy link
Member

@YangKeao YangKeao commented Sep 9, 2021

What problem does this PR solve?

Issue Number: close #2247

Problem Summary:

NetworkChaos doesn't support selecting different interfaces yet. All NetworkChaos will operate on interface eth0. However, with Multus or some other CNI, it's possible to have multiple different interfaces.

What is changed and how it works?

The device argument was added to the protobuf protocol, and the tc command/iptables command will use corresponding arguments to add netem/iptables rules on the specific interface.

Related changes

  • PR to update chaos-mesh/website/chaos-mesh/website-zh: TODO
  • Need to update Chaos Dashboard component, related issue: TODO
  • Need to cheery-pick to the release branch: No

Checklist

Tests

  • Manual test

I created a cluster with Multus, and test the NetworkChaos on it.

Release note

support select different interface in networkchaos

Signed-off-by: YangKeao <yangkeao@chunibyo.icu>
Signed-off-by: YangKeao <yangkeao@chunibyo.icu>
@ti-chi-bot
Copy link
Member

ti-chi-bot commented Sep 9, 2021

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • STRRL
  • WangXiangUSTC

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

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

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@STRRL STRRL added this to the Release 2.1 milestone Sep 10, 2021
@STRRL STRRL added this to In progress in Project Kanban via automation Sep 10, 2021
Signed-off-by: YangKeao <yangkeao@chunibyo.icu>
Signed-off-by: YangKeao <yangkeao@chunibyo.icu>
@YangKeao
Copy link
Member Author

/run-e2e-tests

Signed-off-by: YangKeao <yangkeao@chunibyo.icu>
@YangKeao
Copy link
Member Author

/run-e2e-tests

Signed-off-by: YangKeao <yangkeao@chunibyo.icu>
Signed-off-by: YangKeao <yangkeao@chunibyo.icu>
…networkchaos

Signed-off-by: YangKeao <yangkeao@chunibyo.icu>
@YangKeao
Copy link
Member Author

/run-e2e-tests

3 similar comments
@cwen0
Copy link
Member

cwen0 commented Sep 27, 2021

/run-e2e-tests

@Andrewmatilde
Copy link
Member

/run-e2e-tests

@YangKeao
Copy link
Member Author

YangKeao commented Oct 8, 2021

/run-e2e-tests

@YangKeao
Copy link
Member Author

YangKeao commented Oct 9, 2021

/run-e2e-tests

@YangKeao YangKeao requested review from cwen0 and STRRL October 11, 2021 02:14
@YangKeao
Copy link
Member Author

/run-e2e-tests

@YangKeao
Copy link
Member Author

/run-e2e-tests

pkg/chaosdaemon/tc_server.go Outdated Show resolved Hide resolved
pkg/chaosdaemon/tc_server.go Show resolved Hide resolved
Copy link
Contributor

@WangXiangUSTC WangXiangUSTC left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@STRRL STRRL left a comment

Choose a reason for hiding this comment

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

LGTM!

@STRRL
Copy link
Member

STRRL commented Oct 25, 2021

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: 4bc5e31

@STRRL
Copy link
Member

STRRL commented Oct 25, 2021

I noticed that there are still some TODO works on docs and frontend, PTAL @YangKeao @g1eny0ung .

@ti-chi-bot ti-chi-bot merged commit e79e27b into chaos-mesh:master Oct 25, 2021
Project Kanban automation moved this from In progress to Done Oct 25, 2021
TangliziGit pushed a commit to TangliziGit/chaos-mesh that referenced this pull request Oct 26, 2021
…os-mesh#2290)

* add device field

Signed-off-by: YangKeao <yangkeao@chunibyo.icu>

* support select interface

Signed-off-by: YangKeao <yangkeao@chunibyo.icu>

* fix yaml files

Signed-off-by: YangKeao <yangkeao@chunibyo.icu>

* filter interface according to input and output

Signed-off-by: YangKeao <yangkeao@chunibyo.icu>

* remove duplicate cases

Signed-off-by: YangKeao <yangkeao@chunibyo.icu>

* fix e2e test

Signed-off-by: YangKeao <yangkeao@chunibyo.icu>

* add comments

Signed-off-by: YangKeao <yangkeao@chunibyo.icu>

* refine the check condition

Signed-off-by: YangKeao <yangkeao@chunibyo.icu>

* handle error from json.Unmarshal

Signed-off-by: YangKeao <yangkeao@chunibyo.icu>

Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
@g1eny0ung
Copy link
Member

g1eny0ung commented Oct 25, 2022

Please add the description of the targetDevice field to the docs. @YangKeao

@g1eny0ung
Copy link
Member

g1eny0ung commented Oct 25, 2022

Also, it's better to add an example (with an explanation) to tell people how to use it. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

Support for multiple pod networks
7 participants