Skip to content

Commit

Permalink
SameLabels support for ACNP peer Namespace selection (antrea-io#4537)
Browse files Browse the repository at this point in the history
This PR adds the `sameLabels` field in ACNP peer's namespaces.
The usecase for this field is to allow cluster admins to create ACNPs that
isolate Namespaces based on their label values. For example, if there are
numerous Namespaces in the cluster that has label tier=production and
other Namespaces with label tier=dev, admins can create a single ACNP
that says the production Namespaces can only communicate within
themselves, and same for the dev Namespaces.

Signed-off-by: Dyanngg <dingyang@vmware.com>
  • Loading branch information
Dyanngg authored Mar 19, 2024
1 parent bc54253 commit 59f642a
Show file tree
Hide file tree
Showing 28 changed files with 2,305 additions and 1,483 deletions.
16 changes: 14 additions & 2 deletions build/charts/antrea/crds/clusternetworkpolicy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1076,11 +1076,17 @@ spec:
type: object
namespaces:
type: object
maxProperties: 1
minProperties: 1
properties:
match:
type: string
enum:
- Self
type: string
sameLabels:
type: array
items:
type: string
ipBlock:
type: object
properties:
Expand Down Expand Up @@ -1352,11 +1358,17 @@ spec:
type: object
namespaces:
type: object
maxProperties: 1
minProperties: 1
properties:
match:
type: string
enum:
- Self
type: string
sameLabels:
type: array
items:
type: string
ipBlock:
type: object
properties:
Expand Down
16 changes: 14 additions & 2 deletions build/yamls/antrea-aks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1642,11 +1642,17 @@ spec:
type: object
namespaces:
type: object
maxProperties: 1
minProperties: 1
properties:
match:
type: string
enum:
- Self
type: string
sameLabels:
type: array
items:
type: string
ipBlock:
type: object
properties:
Expand Down Expand Up @@ -1918,11 +1924,17 @@ spec:
type: object
namespaces:
type: object
maxProperties: 1
minProperties: 1
properties:
match:
type: string
enum:
- Self
type: string
sameLabels:
type: array
items:
type: string
ipBlock:
type: object
properties:
Expand Down
16 changes: 14 additions & 2 deletions build/yamls/antrea-crds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1635,11 +1635,17 @@ spec:
type: object
namespaces:
type: object
maxProperties: 1
minProperties: 1
properties:
match:
type: string
enum:
- Self
type: string
sameLabels:
type: array
items:
type: string
ipBlock:
type: object
properties:
Expand Down Expand Up @@ -1911,11 +1917,17 @@ spec:
type: object
namespaces:
type: object
maxProperties: 1
minProperties: 1
properties:
match:
type: string
enum:
- Self
type: string
sameLabels:
type: array
items:
type: string
ipBlock:
type: object
properties:
Expand Down
16 changes: 14 additions & 2 deletions build/yamls/antrea-eks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1642,11 +1642,17 @@ spec:
type: object
namespaces:
type: object
maxProperties: 1
minProperties: 1
properties:
match:
type: string
enum:
- Self
type: string
sameLabels:
type: array
items:
type: string
ipBlock:
type: object
properties:
Expand Down Expand Up @@ -1918,11 +1924,17 @@ spec:
type: object
namespaces:
type: object
maxProperties: 1
minProperties: 1
properties:
match:
type: string
enum:
- Self
type: string
sameLabels:
type: array
items:
type: string
ipBlock:
type: object
properties:
Expand Down
16 changes: 14 additions & 2 deletions build/yamls/antrea-gke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1642,11 +1642,17 @@ spec:
type: object
namespaces:
type: object
maxProperties: 1
minProperties: 1
properties:
match:
type: string
enum:
- Self
type: string
sameLabels:
type: array
items:
type: string
ipBlock:
type: object
properties:
Expand Down Expand Up @@ -1918,11 +1924,17 @@ spec:
type: object
namespaces:
type: object
maxProperties: 1
minProperties: 1
properties:
match:
type: string
enum:
- Self
type: string
sameLabels:
type: array
items:
type: string
ipBlock:
type: object
properties:
Expand Down
16 changes: 14 additions & 2 deletions build/yamls/antrea-ipsec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1642,11 +1642,17 @@ spec:
type: object
namespaces:
type: object
maxProperties: 1
minProperties: 1
properties:
match:
type: string
enum:
- Self
type: string
sameLabels:
type: array
items:
type: string
ipBlock:
type: object
properties:
Expand Down Expand Up @@ -1918,11 +1924,17 @@ spec:
type: object
namespaces:
type: object
maxProperties: 1
minProperties: 1
properties:
match:
type: string
enum:
- Self
type: string
sameLabels:
type: array
items:
type: string
ipBlock:
type: object
properties:
Expand Down
16 changes: 14 additions & 2 deletions build/yamls/antrea.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1642,11 +1642,17 @@ spec:
type: object
namespaces:
type: object
maxProperties: 1
minProperties: 1
properties:
match:
type: string
enum:
- Self
type: string
sameLabels:
type: array
items:
type: string
ipBlock:
type: object
properties:
Expand Down Expand Up @@ -1918,11 +1924,17 @@ spec:
type: object
namespaces:
type: object
maxProperties: 1
minProperties: 1
properties:
match:
type: string
enum:
- Self
type: string
sameLabels:
type: array
items:
type: string
ipBlock:
type: object
properties:
Expand Down
Loading

0 comments on commit 59f642a

Please sign in to comment.