-
Notifications
You must be signed in to change notification settings - Fork 363
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for Namespaced Group CRD (#2438)
Add Group CRD which is responsible for collecting Pods and Namespaces in the Group's Namespace based on labelselectors defined in the Group definition. It also allows setting an IPBlock and ChildGroups (cannot be set with other Selectors) in the Group. The purpose of a Group is to allow grouping of resources and then be referenced in AntreaNetworkPolicies without having to add the same selectors in every ANP when the group of resources are meant to be shared. This allows for greater sharing and decouples the job of reconciling effective group members from that of enforcing security policies. This PR adds the following: -Group API types -Group CRD YAML -Controller changes to reconcile effective members of a Group -Controller changes to trigger ANP update introduced by a Group -Validation webhook to validate a GroupSpec -NetworkPolicyStatus refactored with Conditions Signed-off-by: Qiyue Yao <yaoq@vmware.com> Co-authored-by: Qiyue Yao <yaoq@vmware.com> Co-authored-by: abhiraut <rauta@vmware.com>
- Loading branch information
Showing
59 changed files
with
5,086 additions
and
272 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
apiVersion: apiextensions.k8s.io/v1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
name: groups.crd.antrea.io | ||
spec: | ||
group: crd.antrea.io | ||
versions: | ||
- name: v1alpha3 | ||
served: true | ||
storage: true | ||
schema: | ||
openAPIV3Schema: | ||
type: object | ||
properties: | ||
spec: | ||
type: object | ||
properties: | ||
childGroups: | ||
type: array | ||
items: | ||
type: string | ||
podSelector: | ||
type: object | ||
properties: | ||
matchExpressions: | ||
type: array | ||
items: | ||
type: object | ||
properties: | ||
key: | ||
type: string | ||
operator: | ||
enum: | ||
- In | ||
- NotIn | ||
- Exists | ||
- DoesNotExist | ||
type: string | ||
values: | ||
type: array | ||
items: | ||
type: string | ||
matchLabels: | ||
x-kubernetes-preserve-unknown-fields: true | ||
namespaceSelector: | ||
type: object | ||
properties: | ||
matchExpressions: | ||
type: array | ||
items: | ||
type: object | ||
properties: | ||
key: | ||
type: string | ||
operator: | ||
enum: | ||
- In | ||
- NotIn | ||
- Exists | ||
- DoesNotExist | ||
type: string | ||
values: | ||
type: array | ||
items: | ||
type: string | ||
matchLabels: | ||
x-kubernetes-preserve-unknown-fields: true | ||
externalEntitySelector: | ||
type: object | ||
properties: | ||
matchExpressions: | ||
type: array | ||
items: | ||
type: object | ||
properties: | ||
key: | ||
type: string | ||
operator: | ||
enum: | ||
- In | ||
- NotIn | ||
- Exists | ||
- DoesNotExist | ||
type: string | ||
values: | ||
type: array | ||
items: | ||
type: string | ||
matchLabels: | ||
x-kubernetes-preserve-unknown-fields: true | ||
ipBlocks: | ||
type: array | ||
items: | ||
type: object | ||
properties: | ||
cidr: | ||
type: string | ||
format: cidr | ||
serviceReference: | ||
type: object | ||
properties: | ||
name: | ||
type: string | ||
namespace: | ||
type: string | ||
status: | ||
type: object | ||
properties: | ||
conditions: | ||
type: array | ||
items: | ||
type: object | ||
properties: | ||
type: | ||
type: string | ||
status: | ||
type: string | ||
lastTransitionTime: | ||
type: string | ||
subresources: | ||
status: {} | ||
scope: Namespaced | ||
names: | ||
plural: groups | ||
singular: group | ||
kind: Group | ||
shortNames: | ||
- grp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.