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 Antrea NetworkPolicy documentation #1194

Merged
merged 7 commits into from
Sep 9, 2020
Merged

Conversation

abhiraut
Copy link
Contributor

@abhiraut abhiraut commented Sep 1, 2020

With the addition of namespaced Antrea NetworkPolicy, this PR adds relevant documentation.

@antrea-bot
Copy link
Collaborator

Thanks for your PR.
Unit tests and code linters are run automatically every time the PR is updated.
E2e, conformance and network policy tests can only be triggered by a member of the vmware-tanzu organization. Regular contributors to the project should join the org.

The following commands are available:

  • /test-e2e: to trigger e2e tests.
  • /skip-e2e: to skip e2e tests.
  • /test-conformance: to trigger conformance tests.
  • /skip-conformance: to skip conformance tests.
  • /test-whole-conformance: to trigger all conformance tests on linux.
  • /skip-whole-conformance: to skip all conformance tests on linux.
  • /test-networkpolicy: to trigger networkpolicy tests.
  • /skip-networkpolicy: to skip networkpolicy tests.
  • /test-windows-conformance: to trigger windows conformance tests.
  • /skip-windows-conformance: to skip windows conformance tests.
  • /test-windows-networkpolicy: to trigger windows networkpolicy tests.
  • /skip-windows-networkpolicy: to skip windows networkpolicy tests.
  • /test-hw-offload: to trigger ovs hardware offload test.
  • /skip-hw-offload: to skip ovs hardware offload test.
  • /test-all: to trigger all tests (except whole conformance).
  • /skip-all: to skip all tests (except whole conformance).

@codecov-commenter
Copy link

codecov-commenter commented Sep 1, 2020

Codecov Report

Merging #1194 into master will decrease coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1194      +/-   ##
==========================================
- Coverage   56.23%   56.21%   -0.02%     
==========================================
  Files         106      106              
  Lines       11568    11568              
==========================================
- Hits         6505     6503       -2     
- Misses       4493     4494       +1     
- Partials      570      571       +1     
Flag Coverage Δ
#integration-tests 47.33% <ø> (ø)
#unit-tests 41.70% <ø> (-0.02%) ⬇️

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

Impacted Files Coverage Δ
pkg/apiserver/storage/ram/store.go 80.39% <0.00%> (-1.31%) ⬇️

@abhiraut
Copy link
Contributor Author

abhiraut commented Sep 2, 2020

/skip-all

Dyanngg
Dyanngg previously approved these changes Sep 2, 2020
Copy link
Contributor

@Dyanngg Dyanngg left a comment

Choose a reason for hiding this comment

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

LGTM

docs/network-policy.md Outdated Show resolved Hide resolved
docs/network-policy.md Outdated Show resolved Hide resolved

Antrea NetworkPolicy is another Policy CRD, which is similar to the
ClusterNetworkPolicy CRD, however its scope is limited to a Namespace.
The purpose of introducing this CRD is to allow admins to take advantage of
Copy link
Contributor

Choose a reason for hiding this comment

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

is it still targeted at cluster admins specifically?

I'm asking because above you removed "admin-created" from this sentence:

Thus, admin created tiered policies have a higher precedence over developer-created K8s NetworkPolicies.

And I assumed it was because of the addition of the Antrea NetworkPolicy CRD.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes i thought about it while adding the ANP.. but then since one can add a ANP with higher precedence over existing CNP.. it does not make sense to have ANP associated with devs.. i will restore the original statement above

Copy link
Contributor

Choose a reason for hiding this comment

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

Agreed that both CRDs should be admin oriented

docs/network-policy.md Outdated Show resolved Hide resolved
docs/network-policy.md Outdated Show resolved Hide resolved
antoninbas
antoninbas previously approved these changes Sep 3, 2020
Copy link
Contributor

@antoninbas antoninbas left a comment

Choose a reason for hiding this comment

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

one nit, otherwise LGTM

docs/network-policy.md Outdated Show resolved Hide resolved
@abhiraut
Copy link
Contributor Author

abhiraut commented Sep 3, 2020

/skip-all

antoninbas
antoninbas previously approved these changes Sep 3, 2020
@abhiraut
Copy link
Contributor Author

abhiraut commented Sep 3, 2020

/skip-hw-offload

Dyanngg
Dyanngg previously approved these changes Sep 3, 2020
Copy link
Contributor

@Dyanngg Dyanngg left a comment

Choose a reason for hiding this comment

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

re-approving since comments are resolved

@abhiraut
Copy link
Contributor Author

abhiraut commented Sep 8, 2020

@jianjuns any comments?

Copy link
Contributor

@jianjuns jianjuns left a comment

Choose a reason for hiding this comment

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

Sorry, did not get time for a detailed review. LGTM after a quick scan.

Added a question.

port: 5978
```

### Policy ordering based on priorities
Copy link
Contributor

Choose a reason for hiding this comment

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

This section should be moved to ClusterNetworkPolicy as it applies to both?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we either move common contents to a separate common section, or put them in ClusterNetworkPolicy (as it is talked first). I saw sections like "Rule enforcement based on priorities" are similar to this one?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

moved to CNP section ..

@abhiraut abhiraut dismissed stale reviews from Dyanngg and antoninbas via d4cf46c September 8, 2020 22:35
enforced. Within a tier, rules belonging to Cluster NetworkPolicy CRDs are
to the "Emergency" tier are enforced first, followed by policies associated
with the "SecurityOps" tier and so on, until the "Application" tier policies
are enforced. Within a tier, rules belonging to Cluster NetworkPolicy CRDs are
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you feel these overlap with what you added? Should we just revise this section (or move some contents about tier and policy priority to your section, but keep rule priority here)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

revised it in its own section..

### Ordering based on Tier priority

With the introduction of tiers, Antrea Policies, like ClusterNetworkPolicies,
are first enforced based on the tier to which they are associated with. i.e.
Copy link
Contributor

Choose a reason for hiding this comment

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

associated with -> associated (as already have "to which")?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

With the introduction of tiers, Antrea Policies, like ClusterNetworkPolicies,
are first enforced based on the tier to which they are associated with. i.e.
all policies belonging to the "Emergency" tier are enforced first, followed by
policies associated with the "SecurityOps" tier and so on, until the
Copy link
Contributor

Choose a reason for hiding this comment

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

"associated with" -> "belonging to"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@abhiraut
Copy link
Contributor Author

abhiraut commented Sep 9, 2020

/skip-all

@abhiraut
Copy link
Contributor Author

abhiraut commented Sep 9, 2020

/skip-hw-offload

jianjuns
jianjuns previously approved these changes Sep 9, 2020
Dyanngg
Dyanngg previously approved these changes Sep 9, 2020
antoninbas
antoninbas previously approved these changes Sep 9, 2020
@abhiraut
Copy link
Contributor Author

abhiraut commented Sep 9, 2020

/skip-all

@abhiraut
Copy link
Contributor Author

abhiraut commented Sep 9, 2020

/skip-hw-offload

@abhiraut
Copy link
Contributor Author

abhiraut commented Sep 9, 2020

rebased to get rid of kind testing on doc pr

Copy link
Contributor

@antoninbas antoninbas left a comment

Choose a reason for hiding this comment

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

Approving again

@abhiraut abhiraut merged commit e159995 into antrea-io:master Sep 9, 2020
@abhiraut abhiraut deleted the anp-doc branch September 9, 2020 20:07
GraysonWu pushed a commit to GraysonWu/antrea that referenced this pull request Sep 22, 2020
Add documentation regarding the namespaced Antrea NetworkPolicy CRD
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.

7 participants