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

[ExternalNode] Handle ExternalNode from Antrea agent side #3799

Conversation

mengdie-song
Copy link
Contributor

@mengdie-song mengdie-song commented May 17, 2022

  1. Provide an example RBAC yaml file for Antrea agent running
    on VM with definitions of ClusterRole, ServiceAccount and
    ClusterRoleBinding.

  2. Add ExternalNodeController to monitor ExternalNode CRUD,
    invoke interfaces to operate OVS and update interface store
    with ExternalEntityInterface.

  3. Implement OVS interactions related to ExternalNode CRUD.

  4. Add a channel for receiving ExternalEntity updates from
    ExternalNodeController and notifying NetworkPolicyController
    to reconcile rules related to the updated ExternalEntities.
    This is to handle the case when NetworkPolicyController reconciles
    rules before ExternalEntityInterface is realized in the
    interface store.

  5. Support configuring policy bypass rules to skip ANP check.

Signed-off-by: Mengdie Song [email protected]
Co-authored-by: Wenying Dong [email protected]

@codecov-commenter
Copy link

codecov-commenter commented May 17, 2022

Codecov Report

Merging #3799 (85e4f5f) into feature/externalnode (307ba74) will increase coverage by 2.83%.
The diff coverage is n/a.

Impacted file tree graph

@@                   Coverage Diff                    @@
##           feature/externalnode    #3799      +/-   ##
========================================================
+ Coverage                 63.40%   66.23%   +2.83%     
========================================================
  Files                       291      303      +12     
  Lines                     41823    45180    +3357     
========================================================
+ Hits                      26517    29925    +3408     
+ Misses                    13155    12910     -245     
- Partials                   2151     2345     +194     
Flag Coverage Δ
e2e-tests 39.91% <ø> (?)
integration-tests 35.97% <ø> (?)
kind-e2e-tests 49.43% <ø> (-1.41%) ⬇️
unit-tests 43.90% <ø> (-0.22%) ⬇️
Impacted Files Coverage Δ
...icluster/cmd/multicluster-controller/controller.go 8.33% <ø> (+1.88%) ⬆️
multicluster/cmd/multicluster-controller/leader.go 0.00% <ø> (ø)
...icluster/controllers/multicluster/common/helper.go 58.00% <ø> (ø)
...lticluster/commonarea/resourceimport_controller.go 77.73% <ø> (+8.38%) ⬆️
...uster/controllers/multicluster/controller_utils.go 27.55% <ø> (ø)
...ter/controllers/multicluster/gateway_controller.go 44.51% <ø> (+0.68%) ⬆️
...llers/multicluster/leader_clusterset_controller.go 64.02% <ø> (+0.26%) ⬆️
...llers/multicluster/member_clusterset_controller.go 72.17% <ø> (+62.43%) ⬆️
...s/multicluster/memberclusterannounce_controller.go 71.79% <ø> (+6.79%) ⬆️
...luster/controllers/multicluster/node_controller.go 65.95% <ø> (+0.36%) ⬆️
... and 136 more

@wenyingd wenyingd force-pushed the feature/externalnode branch from 7242689 to 9a0bf16 Compare May 20, 2022 04:39
@wenyingd wenyingd force-pushed the feature/externalnode branch 2 times, most recently from 3d5f3f5 to 9c7554a Compare May 27, 2022 09:33
@mengdie-song mengdie-song force-pushed the feature-externalnode-agent branch from 004ba82 to 87abc07 Compare May 31, 2022 09:06
@mengdie-song
Copy link
Contributor Author

/test-all

@XinShuYang XinShuYang force-pushed the feature-externalnode-agent branch 2 times, most recently from 5df5815 to f9671a4 Compare June 2, 2022 03:46
@wenyingd wenyingd force-pushed the feature/externalnode branch from e7ce899 to 67f3dc9 Compare June 6, 2022 03:11
@mengdie-song mengdie-song force-pushed the feature-externalnode-agent branch from f9671a4 to 2235866 Compare June 9, 2022 09:48
@wenyingd wenyingd force-pushed the feature/externalnode branch from a4cc52a to 2554975 Compare June 9, 2022 09:58
@mengdie-song mengdie-song force-pushed the feature-externalnode-agent branch from 2235866 to e404f1a Compare June 10, 2022 01:54
@mengdie-song mengdie-song force-pushed the feature-externalnode-agent branch 2 times, most recently from 96de75f to f6a837f Compare June 14, 2022 09:33
@lgtm-com
Copy link

lgtm-com bot commented Jun 14, 2022

This pull request introduces 2 alerts when merging f6a837f into 2554975 - view on LGTM.com

new alerts:

  • 1 for Incorrect conversion between integer types
  • 1 for Useless assignment to local variable

@mengdie-song mengdie-song force-pushed the feature-externalnode-agent branch from f6a837f to 7c4624b Compare June 14, 2022 10:56
@lgtm-com
Copy link

lgtm-com bot commented Jun 14, 2022

This pull request introduces 2 alerts when merging 7c4624b into 2554975 - view on LGTM.com

new alerts:

  • 1 for Incorrect conversion between integer types
  • 1 for Useless assignment to local variable

@mengdie-song mengdie-song force-pushed the feature-externalnode-agent branch from 7c4624b to dda83b7 Compare June 15, 2022 08:54
@lgtm-com
Copy link

lgtm-com bot commented Jun 15, 2022

This pull request introduces 1 alert when merging dda83b7 into 2554975 - view on LGTM.com

new alerts:

  • 1 for Incorrect conversion between integer types

@XinShuYang XinShuYang force-pushed the feature-externalnode-agent branch from dda83b7 to c40d85b Compare June 16, 2022 09:22
@lgtm-com
Copy link

lgtm-com bot commented Jun 16, 2022

This pull request introduces 1 alert when merging c40d85b into 2554975 - view on LGTM.com

new alerts:

  • 1 for Incorrect conversion between integer types

@XinShuYang XinShuYang force-pushed the feature-externalnode-agent branch from c40d85b to 330c51a Compare June 16, 2022 11:09
@lgtm-com
Copy link

lgtm-com bot commented Jun 16, 2022

This pull request introduces 1 alert when merging 330c51a into 2554975 - view on LGTM.com

new alerts:

  • 1 for Incorrect conversion between integer types

@mengdie-song mengdie-song force-pushed the feature-externalnode-agent branch from 330c51a to 036cab6 Compare June 20, 2022 09:07
@lgtm-com
Copy link

lgtm-com bot commented Jun 20, 2022

This pull request introduces 1 alert when merging 036cab6 into 2554975 - view on LGTM.com

new alerts:

  • 1 for Incorrect conversion between integer types

@mengdie-song mengdie-song force-pushed the feature-externalnode-agent branch 2 times, most recently from ae2a0a1 to 5557fdd Compare June 21, 2022 08:06
@mengdie-song mengdie-song requested review from jianjuns and tnqn June 21, 2022 08:23
@XinShuYang XinShuYang force-pushed the feature-externalnode-agent branch from 30c266b to 834f346 Compare July 29, 2022 08:43
Copy link
Member

@tnqn tnqn left a comment

Choose a reason for hiding this comment

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

LGTM, one minor comment, and the commit body is not aligned properly

pkg/agent/externalnode/external_node_controller.go Outdated Show resolved Hide resolved
@mengdie-song mengdie-song force-pushed the feature-externalnode-agent branch from 834f346 to 2d1ef2a Compare August 2, 2022 01:47
Copy link
Contributor

@wenyingd wenyingd left a comment

Choose a reason for hiding this comment

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

LGTM

@tnqn
Copy link
Member

tnqn commented Aug 2, 2022

@mengdie-song where is this change?

  1. Update NetworkPolicy reconciler to invoke GetInterfacesByEntity()
    and GetContainerInterfacesByPod() for ExternalEntity and
    Pod separately.

@mengdie-song mengdie-song force-pushed the feature-externalnode-agent branch from 2d1ef2a to 7f28851 Compare August 2, 2022 03:47
@mengdie-song
Copy link
Contributor Author

@tnqn Thanks a lot for the careful review. I realized that we have moved this part into a separate PR #3768 which has already been merged. I have updated the commit message.

@mengdie-song mengdie-song force-pushed the feature-externalnode-agent branch from 7f28851 to 81abd06 Compare August 2, 2022 03:54
1. Provide an example RBAC yaml file for Antrea agent running
on VM with definitions of ClusterRole, ServiceAccount and
ClusterRoleBinding.

2. Add ExternalNodeController to monitor ExternalNode CRUD,
invoke interfaces to operate OVS and update interface store
with ExternalEntityInterface.

3. Implement OVS interactions related to ExternalNode CRUD.

4. Add a channel for receiving ExternalEntity updates from
ExternalNodeController and notifying NetworkPolicyController
to reconcile rules related to the updated ExternalEntities.
This is to handle the case when NetworkPolicyController reconciles
rules before ExternalEntityInterface is realized in the
interface store.

5. Support configuring policy bypass rules to skip ANP check.

Signed-off-by: Mengdie Song <[email protected]>
Co-authored-by: Wenying Dong <[email protected]>
@mengdie-song mengdie-song force-pushed the feature-externalnode-agent branch from 81abd06 to 85e4f5f Compare August 2, 2022 03:56
Copy link
Member

@tnqn tnqn left a comment

Choose a reason for hiding this comment

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

LGTM

@tnqn tnqn added kind/feature Categorizes issue or PR as related to a new feature. action/release-note Indicates a PR that should be included in release notes. labels Aug 2, 2022
@tnqn
Copy link
Member

tnqn commented Aug 2, 2022

Go / Verify docs and spelling (pull_request) Failing after 17s — Verify docs and spelling

Checking table of contents are up to date...
2022/08/02 04:03:12 docs/vm-installation.md: missing opening TOC tag

@wenyingd
Copy link
Contributor

wenyingd commented Aug 2, 2022

Go / Verify docs and spelling (pull_request) Failing after 17s — Verify docs and spelling

Checking table of contents are up to date...
2022/08/02 04:03:12 docs/vm-installation.md: missing opening TOC tag

This will be resolved in another PR for documentation: #3963

@wenyingd
Copy link
Contributor

wenyingd commented Aug 2, 2022

/test-all

@mengdie-song mengdie-song merged commit 18595a8 into antrea-io:feature/externalnode Aug 2, 2022
mengdie-song added a commit to mengdie-song/antrea that referenced this pull request Aug 3, 2022
…3799)

1. Provide an example RBAC yaml file for Antrea agent running
on VM with definitions of ClusterRole, ServiceAccount and
ClusterRoleBinding.

2. Add ExternalNodeController to monitor ExternalNode CRUD,
invoke interfaces to operate OVS and update interface store
with ExternalEntityInterface.

3. Implement OVS interactions related to ExternalNode CRUD.

4. Add a channel for receiving ExternalEntity updates from
ExternalNodeController and notifying NetworkPolicyController
to reconcile rules related to the updated ExternalEntities.
This is to handle the case when NetworkPolicyController reconciles
rules before ExternalEntityInterface is realized in the
interface store.

5. Support configuring policy bypass rules to skip ANP check.

Signed-off-by: Mengdie Song <[email protected]>
Co-authored-by: Wenying Dong <[email protected]>
mengdie-song added a commit to mengdie-song/antrea that referenced this pull request Aug 3, 2022
…3799)

1. Provide an example RBAC yaml file for Antrea agent running
on VM with definitions of ClusterRole, ServiceAccount and
ClusterRoleBinding.

2. Add ExternalNodeController to monitor ExternalNode CRUD,
invoke interfaces to operate OVS and update interface store
with ExternalEntityInterface.

3. Implement OVS interactions related to ExternalNode CRUD.

4. Add a channel for receiving ExternalEntity updates from
ExternalNodeController and notifying NetworkPolicyController
to reconcile rules related to the updated ExternalEntities.
This is to handle the case when NetworkPolicyController reconciles
rules before ExternalEntityInterface is realized in the
interface store.

5. Support configuring policy bypass rules to skip ANP check.

Signed-off-by: Mengdie Song <[email protected]>
Co-authored-by: Wenying Dong <[email protected]>
mengdie-song added a commit to mengdie-song/antrea that referenced this pull request Aug 3, 2022
…3799)

1. Provide an example RBAC yaml file for Antrea agent running
on VM with definitions of ClusterRole, ServiceAccount and
ClusterRoleBinding.

2. Add ExternalNodeController to monitor ExternalNode CRUD,
invoke interfaces to operate OVS and update interface store
with ExternalEntityInterface.

3. Implement OVS interactions related to ExternalNode CRUD.

4. Add a channel for receiving ExternalEntity updates from
ExternalNodeController and notifying NetworkPolicyController
to reconcile rules related to the updated ExternalEntities.
This is to handle the case when NetworkPolicyController reconciles
rules before ExternalEntityInterface is realized in the
interface store.

5. Support configuring policy bypass rules to skip ANP check.

Signed-off-by: Mengdie Song <[email protected]>
Co-authored-by: Wenying Dong <[email protected]>
mengdie-song added a commit to mengdie-song/antrea that referenced this pull request Aug 8, 2022
…3799)

1. Provide an example RBAC yaml file for Antrea agent running
on VM with definitions of ClusterRole, ServiceAccount and
ClusterRoleBinding.

2. Add ExternalNodeController to monitor ExternalNode CRUD,
invoke interfaces to operate OVS and update interface store
with ExternalEntityInterface.

3. Implement OVS interactions related to ExternalNode CRUD.

4. Add a channel for receiving ExternalEntity updates from
ExternalNodeController and notifying NetworkPolicyController
to reconcile rules related to the updated ExternalEntities.
This is to handle the case when NetworkPolicyController reconciles
rules before ExternalEntityInterface is realized in the
interface store.

5. Support configuring policy bypass rules to skip ANP check.

Signed-off-by: Mengdie Song <[email protected]>
Co-authored-by: Wenying Dong <[email protected]>
mengdie-song added a commit to mengdie-song/antrea that referenced this pull request Aug 8, 2022
…3799)

1. Provide an example RBAC yaml file for Antrea agent running
on VM with definitions of ClusterRole, ServiceAccount and
ClusterRoleBinding.

2. Add ExternalNodeController to monitor ExternalNode CRUD,
invoke interfaces to operate OVS and update interface store
with ExternalEntityInterface.

3. Implement OVS interactions related to ExternalNode CRUD.

4. Add a channel for receiving ExternalEntity updates from
ExternalNodeController and notifying NetworkPolicyController
to reconcile rules related to the updated ExternalEntities.
This is to handle the case when NetworkPolicyController reconciles
rules before ExternalEntityInterface is realized in the
interface store.

5. Support configuring policy bypass rules to skip ANP check.

Signed-off-by: Mengdie Song <[email protected]>
Co-authored-by: Wenying Dong <[email protected]>
mengdie-song added a commit to mengdie-song/antrea that referenced this pull request Aug 8, 2022
…3799)

1. Provide an example RBAC yaml file for Antrea agent running
on VM with definitions of ClusterRole, ServiceAccount and
ClusterRoleBinding.

2. Add ExternalNodeController to monitor ExternalNode CRUD,
invoke interfaces to operate OVS and update interface store
with ExternalEntityInterface.

3. Implement OVS interactions related to ExternalNode CRUD.

4. Add a channel for receiving ExternalEntity updates from
ExternalNodeController and notifying NetworkPolicyController
to reconcile rules related to the updated ExternalEntities.
This is to handle the case when NetworkPolicyController reconciles
rules before ExternalEntityInterface is realized in the
interface store.

5. Support configuring policy bypass rules to skip ANP check.

Signed-off-by: Mengdie Song <[email protected]>
Co-authored-by: Wenying Dong <[email protected]>
mengdie-song added a commit to mengdie-song/antrea that referenced this pull request Aug 8, 2022
…3799)

1. Provide an example RBAC yaml file for Antrea agent running
on VM with definitions of ClusterRole, ServiceAccount and
ClusterRoleBinding.

2. Add ExternalNodeController to monitor ExternalNode CRUD,
invoke interfaces to operate OVS and update interface store
with ExternalEntityInterface.

3. Implement OVS interactions related to ExternalNode CRUD.

4. Add a channel for receiving ExternalEntity updates from
ExternalNodeController and notifying NetworkPolicyController
to reconcile rules related to the updated ExternalEntities.
This is to handle the case when NetworkPolicyController reconciles
rules before ExternalEntityInterface is realized in the
interface store.

5. Support configuring policy bypass rules to skip ANP check.

Signed-off-by: Mengdie Song <[email protected]>
Co-authored-by: Wenying Dong <[email protected]>
wenyingd added a commit that referenced this pull request Aug 8, 2022
1. Provide an example RBAC yaml file for Antrea agent running
on VM with definitions of ClusterRole, ServiceAccount and
ClusterRoleBinding.

2. Add ExternalNodeController to monitor ExternalNode CRUD,
invoke interfaces to operate OVS and update interface store
with ExternalEntityInterface.

3. Implement OVS interactions related to ExternalNode CRUD.

4. Add a channel for receiving ExternalEntity updates from
ExternalNodeController and notifying NetworkPolicyController
to reconcile rules related to the updated ExternalEntities.
This is to handle the case when NetworkPolicyController reconciles
rules before ExternalEntityInterface is realized in the
interface store.

5. Support configuring policy bypass rules to skip ANP check.

Signed-off-by: Mengdie Song <[email protected]>
Co-authored-by: wenyingd <[email protected]>
wenyingd added a commit to wenyingd/antrea that referenced this pull request Aug 10, 2022
…3799)

1. Provide an example RBAC yaml file for Antrea agent running
on VM with definitions of ClusterRole, ServiceAccount and
ClusterRoleBinding.

2. Add ExternalNodeController to monitor ExternalNode CRUD,
invoke interfaces to operate OVS and update interface store
with ExternalEntityInterface.

3. Implement OVS interactions related to ExternalNode CRUD.

4. Add a channel for receiving ExternalEntity updates from
ExternalNodeController and notifying NetworkPolicyController
to reconcile rules related to the updated ExternalEntities.
This is to handle the case when NetworkPolicyController reconciles
rules before ExternalEntityInterface is realized in the
interface store.

5. Support configuring policy bypass rules to skip ANP check.

Signed-off-by: Mengdie Song <[email protected]>
Co-authored-by: wenyingd <[email protected]>
wenyingd added a commit to wenyingd/antrea that referenced this pull request Aug 10, 2022
…3799)

1. Provide an example RBAC yaml file for Antrea agent running
on VM with definitions of ClusterRole, ServiceAccount and
ClusterRoleBinding.

2. Add ExternalNodeController to monitor ExternalNode CRUD,
invoke interfaces to operate OVS and update interface store
with ExternalEntityInterface.

3. Implement OVS interactions related to ExternalNode CRUD.

4. Add a channel for receiving ExternalEntity updates from
ExternalNodeController and notifying NetworkPolicyController
to reconcile rules related to the updated ExternalEntities.
This is to handle the case when NetworkPolicyController reconciles
rules before ExternalEntityInterface is realized in the
interface store.

5. Support configuring policy bypass rules to skip ANP check.

Signed-off-by: Mengdie Song <[email protected]>
Co-authored-by: wenyingd <[email protected]>
wenyingd added a commit to wenyingd/antrea that referenced this pull request Aug 11, 2022
…3799)

1. Provide an example RBAC yaml file for Antrea agent running
on VM with definitions of ClusterRole, ServiceAccount and
ClusterRoleBinding.

2. Add ExternalNodeController to monitor ExternalNode CRUD,
invoke interfaces to operate OVS and update interface store
with ExternalEntityInterface.

3. Implement OVS interactions related to ExternalNode CRUD.

4. Add a channel for receiving ExternalEntity updates from
ExternalNodeController and notifying NetworkPolicyController
to reconcile rules related to the updated ExternalEntities.
This is to handle the case when NetworkPolicyController reconciles
rules before ExternalEntityInterface is realized in the
interface store.

5. Support configuring policy bypass rules to skip ANP check.

Signed-off-by: Mengdie Song <[email protected]>
Co-authored-by: wenyingd <[email protected]>
wenyingd added a commit that referenced this pull request Aug 11, 2022
1. Provide an example RBAC yaml file for Antrea agent running
on VM with definitions of ClusterRole, ServiceAccount and
ClusterRoleBinding.

2. Add ExternalNodeController to monitor ExternalNode CRUD,
invoke interfaces to operate OVS and update interface store
with ExternalEntityInterface.

3. Implement OVS interactions related to ExternalNode CRUD.

4. Add a channel for receiving ExternalEntity updates from
ExternalNodeController and notifying NetworkPolicyController
to reconcile rules related to the updated ExternalEntities.
This is to handle the case when NetworkPolicyController reconciles
rules before ExternalEntityInterface is realized in the
interface store.

5. Support configuring policy bypass rules to skip ANP check.

Signed-off-by: Mengdie Song <[email protected]>
Co-authored-by: wenyingd <[email protected]>
heanlan pushed a commit to heanlan/antrea that referenced this pull request Mar 29, 2023
…3799)

1. Provide an example RBAC yaml file for Antrea agent running
on VM with definitions of ClusterRole, ServiceAccount and
ClusterRoleBinding.

2. Add ExternalNodeController to monitor ExternalNode CRUD,
invoke interfaces to operate OVS and update interface store
with ExternalEntityInterface.

3. Implement OVS interactions related to ExternalNode CRUD.

4. Add a channel for receiving ExternalEntity updates from
ExternalNodeController and notifying NetworkPolicyController
to reconcile rules related to the updated ExternalEntities.
This is to handle the case when NetworkPolicyController reconciles
rules before ExternalEntityInterface is realized in the
interface store.

5. Support configuring policy bypass rules to skip ANP check.

Signed-off-by: Mengdie Song <[email protected]>
Co-authored-by: wenyingd <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action/release-note Indicates a PR that should be included in release notes. kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants