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 tiered policies to Calico OSS #1699

Merged
merged 8 commits into from
Oct 21, 2024
Merged

Conversation

mazdakn
Copy link
Member

@mazdakn mazdakn commented Oct 3, 2024

Doc changes related to:

Product Version(s): Calico v3.29, Calico Enterprise v3.20.2

Issue:

Link to docs preview:

SME review:

  • An SME has approved this change.

DOCS review:

  • A member of the docs team has approved this change.

Additional information:

Merge checklist:

  • Deploy preview inspected wherever changes were made
  • Build completed successfully
  • Test have passed

@mazdakn mazdakn requested a review from a team as a code owner October 3, 2024 17:16
Copy link

netlify bot commented Oct 3, 2024

Deploy Preview for calico-docs-preview-next ready!

Name Link
🔨 Latest commit 42203bf
🔍 Latest deploy log https://app.netlify.com/sites/calico-docs-preview-next/deploys/671297d9d39a84000777d4c7
😎 Deploy Preview https://deploy-preview-1699--calico-docs-preview-next.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 50 (🟢 up 15 from production)
Accessibility: 90 (no change from production)
Best Practices: 83 (no change from production)
SEO: 86 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Oct 3, 2024

Deploy Preview succeeded!

Built without sensitive environment variables

Name Link
🔨 Latest commit 42203bf
🔍 Latest deploy log https://app.netlify.com/sites/tigera/deploys/671297d9f367500008a4da4c
😎 Deploy Preview https://deploy-preview-1699--tigera.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 47 (🟢 up 23 from production)
Accessibility: 90 (no change from production)
Best Practices: 75 (no change from production)
SEO: 93 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

@@ -94,7 +102,7 @@ In the example above, tier priorities are as follows:

- **security tier** - is higher priority than platform tier
- **platform tier** - is higher priority than default tier
- **default tier** - is always the last tier and cannot be reordered
- **default tier** - is the lowest priority than the rest
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- **default tier** - is the lowest priority than the rest
- **default tier** - is the lowest priority.

Previously, is could not be reordered, now it has an order. Can it be reordered? If yes, it would be worth to say that "previously it could not be reordered. It can be now, but we advise against that" or something similar?

Copy link
Member Author

@mazdakn mazdakn Oct 7, 2024

Choose a reason for hiding this comment

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

No, the default tier must have the order of 1M. It cannot be reordered. Previously, it had an order of nil, and now it is 1M and it cannot change. Also any tier with nil order will be treated as 1M.
We will add a release note to warn customers about the change.

@@ -28,7 +28,7 @@ Policies in each Tier are then processed in order.
- If a [NetworkPolicy](networkpolicy.mdx) or [GlobalNetworkPolicy](globalnetworkpolicy.mdx) in the Tier `Allow`s or `Deny`s the packet, then evaluation is done: the packet is handled accordingly.
- If a [NetworkPolicy](networkpolicy.mdx) or [GlobalNetworkPolicy](globalnetworkpolicy.mdx) in the Tier `Pass`es the packet, the next Tier containing a Policy that applies to the endpoint processes the packet.

If the Tier applies to the endpoint, but takes no action on the packet the packet is dropped.
If the Tier applies to the endpoint, but takes no action on the packet the packet is dropped by default. This behaviour can be changed by setting the `defaultAction` to `Pass` for a tier.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
If the Tier applies to the endpoint, but takes no action on the packet the packet is dropped by default. This behaviour can be changed by setting the `defaultAction` to `Pass` for a tier.
If the Tier applies to the endpoint, but takes no action on the packet the packet is dropped by. This behaviour can be changed by setting the `defaultAction` to `Pass` for a tier.

Perhaps chance to clarify If the Tier applies to the endpoint as I was confused what it mean myself. It means that that tier contains a rule that applies to an endpoint? How can it apply to an endpoint and not to take an action? Example?

Copy link
Member Author

Choose a reason for hiding this comment

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

This page is about documenting the resource itself. I believe it should be short and to the point. There is more description about this topic in the tiered policy page: https://docs.tigera.io/calico-enterprise/latest/network-policy/policy-tiers/tiered-policy#default-endpoint-behavior

description: Configure RBAC to control access to policies and tiers.
---

# Configure RBAC for tiered policies
Copy link
Contributor

Choose a reason for hiding this comment

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

I suppose this is just a plain copy from EE, isn't it?

How does the RBAC play with ANP tier? Is there some RBAC created by default or do kubernetes handle it on their own? Idk how it works, just double checking here!

Copy link
Collaborator

Choose a reason for hiding this comment

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

FYI @mazdakn

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, this is just a copy from EE.
ANP design states the API is for cluster administrators. This is not something we enforce though. We provide Tier's RBAC for users to configure the access, so in the end it's up to users to setup the access properly.

calico/network-policy/policy-tiers/tiered-policy.mdx Outdated Show resolved Hide resolved
calico/network-policy/policy-tiers/tiered-policy.mdx Outdated Show resolved Hide resolved

## The default tier:

The default tier is created during installation and has the order of 1,000,000.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
The default tier is created during installation and has the order of 1,000,000.
The default tier is created during installation and has the order of 1,000,000. The desire is to evaluate policies in the default tier as last.

I meantioned it before, but worth spelling it out explicitly whether the order can by changed.

<!--TODO-XREF-CC
If the last Tier applying to the endpoint `Pass`es the packet, that endpoint's [Profiles](/reference/resources/profile) are evaluated.
-->
If the last Tier applying to the endpoint `Pass`es the packet, that endpoint's [Profiles](profile.mdx) are evaluated.
Copy link
Collaborator

Choose a reason for hiding this comment

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

This xref breaks the build. An example of a file from the CE docs that doesn't exist in CC.

Copy link
Contributor

@tomastigera tomastigera left a comment

Choose a reason for hiding this comment

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

a few tiny typos

@@ -62,6 +62,10 @@ The default tier is where:
- Network and global network policies are placed when you upgrade from Project Calico to {{prodname}}
- Recommended policies are placed when you use the **Recommend a policy** feature

## AdminNetworkPolicy tier:

The AdminNetworkPolicy tier where all [Kubernetes admin network policies](https://network-policy-api.sigs.k8s.io/reference/examples/) reside. It is automatically created during installation and has the order of 1,000. This value is fixed, and cannot be changed.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
The AdminNetworkPolicy tier where all [Kubernetes admin network policies](https://network-policy-api.sigs.k8s.io/reference/examples/) reside. It is automatically created during installation and has the order of 1,000. This value is fixed, and cannot be changed.
The AdminNetworkPolicy tier is where all [Kubernetes admin network policies](https://network-policy-api.sigs.k8s.io/reference/examples/) reside. It is automatically created during installation and has the order of 1,000. This value is fixed, and cannot be changed.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed.

@@ -86,21 +90,21 @@ Now you can reorder tiers by dragging and moving them.

## Tier order

Tiers are ordered from left to right, starting with the highest priority (also called highest precedence) tiers.
Tiers are ordered based on their orders (from left to right), starting from the lowest order (the highest priority) tiers.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Tiers are ordered based on their orders (from left to right), starting from the lowest order (the highest priority) tiers.
Tiers are sorted by their orders (from left to right), starting from the lowest order (the highest priority) tiers.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed.


## AdminNetworkPolicy tier:

The AdminNetworkPolicy tier where all [Kubernetes admin network policies](https://network-policy-api.sigs.k8s.io/reference/examples/) reside. It is automatically created during installation and has the order of 1,000. This value is fixed, and cannot be changed.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
The AdminNetworkPolicy tier where all [Kubernetes admin network policies](https://network-policy-api.sigs.k8s.io/reference/examples/) reside. It is automatically created during installation and has the order of 1,000. This value is fixed, and cannot be changed.
The AdminNetworkPolicy tier is where all [Kubernetes admin network policies](https://network-policy-api.sigs.k8s.io/reference/examples/) reside. It is automatically created during installation and has the order of 1,000. This value is fixed, and cannot be changed.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed.

@ctauchen
Copy link
Collaborator

@tmjd There are some changes here to the CC tiers docs. They appear to be removing innocuous diffs between the CE and CC versions. But might be a good idea for you do take a quick pass at the changes here to see if anything is wrong for CC.

--user=<USER\>
```

### Create minimum permissions for all non-Admin users
Copy link
Collaborator

Choose a reason for hiding this comment

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

This section discusses the UI. Not sure how much needs removing. What do you think?

Copy link
Member Author

Choose a reason for hiding this comment

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

Right. Removed it.

Copy link
Member Author

Choose a reason for hiding this comment

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

I believe we can remove the whole section.

description: Configure RBAC to control access to policies and tiers.
---

# Configure RBAC for tiered policies
Copy link
Collaborator

Choose a reason for hiding this comment

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

FYI @mazdakn

@tmjd
Copy link
Member

tmjd commented Oct 18, 2024

@ctauchen I don't see anything that should be different for Calico Cloud.

@mazdakn mazdakn requested a review from ctauchen October 18, 2024 23:07
@ctauchen
Copy link
Collaborator

LGTM

@ctauchen ctauchen merged commit 918ec0c into tigera:main Oct 21, 2024
10 checks passed
@mazdakn mazdakn deleted the calico-tiers branch October 21, 2024 16:23
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.

4 participants