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

Update policy resources with list examples #1361

Merged
merged 2 commits into from
Mar 20, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions calico-enterprise/reference/resources/globalnetworkpolicy.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -187,3 +187,23 @@ Application layer policy match criteria are supported with the following restric
| Datastore type | Create/Delete | Update | Get/List | Notes |
| ------------------------ | ------------- | ------ | -------- | ----- |
| Kubernetes API datastore | Yes | Yes | Yes |

#### List filtering on tiers
List and Watch operations may specify label selector or field selector to filter GlobalNetworkPolicies on tiers returned by the API server.
When no selector is specified the API server returns all GlobalNetworkPolicies from all tiers that the user has access to.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
#### List filtering on tiers
List and Watch operations may specify label selector or field selector to filter GlobalNetworkPolicies on tiers returned by the API server.
When no selector is specified the API server returns all GlobalNetworkPolicies from all tiers that the user has access to.
#### List filtering on tiers
List and watch operations may specify label selectors or field selectors to filter `GlobalNetworkPolicy` resources on tiers returned by the API server.
When no selector is specified, the API server returns all `GlobalNetworkPolicy` resources from all tiers that the user has access to.


##### Field selector
Copy link
Collaborator

Choose a reason for hiding this comment

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

Add newline after heading.

When using the field selector, supported operators are = and ==
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
When using the field selector, supported operators are = and ==
When using the field selector, supported operators are `=` and `==`.


Example to retrieve all GlobalNetworkPolicies in default tier:
```
kubectl get globalnetworkpolicy --field-selector spec.tier=default
```
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
Example to retrieve all GlobalNetworkPolicies in default tier:
```
kubectl get globalnetworkpolicy --field-selector spec.tier=default
```
The following example shows how to retrieve all `GlobalNetworkPolicy` resources in the default tier:
```bash
kubectl get globalnetworkpolicy --field-selector spec.tier=default


##### Label selector
When using the label selector, supported operators are =, == and IN

Example to retrieve all GlobalNetworkPolicies in default and net-sec tier:
```
kubectl get globalnetworkpolicy -l 'projectcalico.org/tier in (default, net-sec)'
```
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
##### Label selector
When using the label selector, supported operators are =, == and IN
Example to retrieve all GlobalNetworkPolicies in default and net-sec tier:
```
kubectl get globalnetworkpolicy -l 'projectcalico.org/tier in (default, net-sec)'
```
##### Label selector
When using the label selector, supported operators are `=`, `==` and `IN`.
The following example shows how to retrieve all `GlobalNetworkPolicy` resources in the `default` and `net-sec` tiers:
```bash
kubectl get globalnetworkpolicy -l 'projectcalico.org/tier in (default, net-sec)'

20 changes: 20 additions & 0 deletions calico-enterprise/reference/resources/networkpolicy.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -172,3 +172,23 @@ Application layer policy match criteria are supported with the following restric
| Datastore type | Create/Delete | Update | Get/List | Notes |
| ------------------------ | ------------- | ------ | -------- | ----- |
| Kubernetes API datastore | Yes | Yes | Yes |

#### List filtering on tiers
List and Watch operations may specify label selector or field selector to filter NetworkPolicies on tiers returned by the API server.
When no selector is specified the API server returns all NetworkPolicies from all tiers that the user has access to.

##### Field selector
When using the field selector, supported operators are = and ==

Example to retrieve all NetworkPolicies in default tier:
```
kubectl get networkpolicy.p --field-selector spec.tier=default
```

##### Label selector
When using the label selector, supported operators are =, == and IN

Example to retrieve all NetworkPolicies in default and net-sec tier:
```
kubectl get networkpolicy.p -l 'projectcalico.org/tier in (default, net-sec)'
```
Original file line number Diff line number Diff line change
Expand Up @@ -160,3 +160,22 @@ process it more efficiently. Currently only one hint is defined:
| Datastore type | Create/Delete | Update | Get/List | Notes |
| ------------------------ | ------------- | ------ | -------- | ----- |
| Kubernetes API datastore | Yes | Yes | Yes |

#### List filtering on tiers
List and Watch operations may specify label selector or field selector to filter StagedGlobalNetworkPolicies on tiers returned by the API server.
When no selector is specified the API server returns all StagedGlobalNetworkPolicies from all tiers that the user has access to.

##### Field selector
When using the field selector, supported operators are = and ==

Example to retrieve all StagedGlobalNetworkPolicies in default tier:
```
kubectl get stagedglobalnetworkpolicy --field-selector spec.tier=default
```

##### Label selector
When using the label selector, supported operators are =, == and IN

Example to retrieve all StagedGlobalNetworkPolicies in default and net-sec tier:
```
kubectl get stagedglobalnetworkpolicy -l 'projectcalico.org/tier in (default, net-sec)'
20 changes: 20 additions & 0 deletions calico-enterprise/reference/resources/stagednetworkpolicy.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -144,3 +144,23 @@ process it more efficiently. Currently only one hint is defined:
| Datastore type | Create/Delete | Update | Get/List | Notes |
| ------------------------ | ------------- | ------ | -------- | ----- |
| Kubernetes API datastore | Yes | Yes | Yes |

#### List filtering on tiers
List and Watch operations may specify label selector or field selector to filter StagedNetworkPolicies on tiers returned by the API server.
When no selector is specified the API server returns all StagedNetworkPolicies from all tiers that the user has access to.

##### Field selector
When using the field selector, supported operators are = and ==

Example to retrieve all StagedNetworkPolicies in default tier:
```
kubectl get stagednetworkpolicy.p --field-selector spec.tier=default
```

##### Label selector
When using the label selector, supported operators are =, == and IN

Example to retrieve all StagedNetworkPolicies in default and net-sec tier:
```
kubectl get stagednetworkpolicy.p -l 'projectcalico.org/tier in (default, net-sec)'
```
Loading