Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
24 changes: 14 additions & 10 deletions apis/v1alpha1/adminnetworkpolicy_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,20 @@ type AdminNetworkPolicyStatus struct {

// AdminNetworkPolicySpec defines the desired state of AdminNetworkPolicy.
type AdminNetworkPolicySpec struct {
// Priority is a value from 0 to 1000. Policies with lower priority values have
// higher precedence, and are checked before policies with higher priority values.
// All AdminNetworkPolicy rules have higher precedence than NetworkPolicy or
// BaselineAdminNetworkPolicy rules.
// If two (or more) policies with the same priority could both match a connection,
// then the implementation can apply any of the matching policies to the
// connection, and there is no way for the user to reliably determine which one it
// will choose. Administrators must be careful about assigning the priorities for
// policies with rules that will match many connections, and ensure that policies
// have unique priority values in cases where ambiguity would be unacceptable.
// Priority is a value from 0 to 1000. Policies with lower
// numeric priority values have higher precedence, and are
// checked before policies with higher numeric priority
// values. All AdminNetworkPolicy rules have higher precedence
// than NetworkPolicy or BaselineAdminNetworkPolicy rules.
//
// If two (or more) policies with equal priority match the
Copy link
Contributor

Choose a reason for hiding this comment

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

connection v/s traffic we should discuss more - #305

I'm pretty sure some implementations do it connection based and that's how initially network policies were also defined.

// same traffic, then any one (and only one) of the policies
// will be applied to the traffic. There is no way for the
// user to reliably determine which policy will be applied.
//
// Administrators should use different priorities numbers if
// non-deterministic matching between overlapping policies is a
// problem.
//
// +kubebuilder:validation:Minimum=0
// +kubebuilder:validation:Maximum=1000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -777,16 +777,20 @@ spec:
type: array
priority:
description: |-
Priority is a value from 0 to 1000. Policies with lower priority values have
higher precedence, and are checked before policies with higher priority values.
All AdminNetworkPolicy rules have higher precedence than NetworkPolicy or
BaselineAdminNetworkPolicy rules.
If two (or more) policies with the same priority could both match a connection,
then the implementation can apply any of the matching policies to the
connection, and there is no way for the user to reliably determine which one it
will choose. Administrators must be careful about assigning the priorities for
policies with rules that will match many connections, and ensure that policies
have unique priority values in cases where ambiguity would be unacceptable.
Priority is a value from 0 to 1000. Policies with lower
numeric priority values have higher precedence, and are
checked before policies with higher numeric priority
values. All AdminNetworkPolicy rules have higher precedence
than NetworkPolicy or BaselineAdminNetworkPolicy rules.

If two (or more) policies with equal priority match the
same traffic, then any one (and only one) of the policies
will be applied to the traffic. There is no way for the
user to reliably determine which policy will be applied.

Administrators should use different priorities numbers if
non-deterministic matching between overlapping policies is a
problem.
format: int32
maximum: 1000
minimum: 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -667,16 +667,20 @@ spec:
type: array
priority:
description: |-
Priority is a value from 0 to 1000. Policies with lower priority values have
higher precedence, and are checked before policies with higher priority values.
All AdminNetworkPolicy rules have higher precedence than NetworkPolicy or
BaselineAdminNetworkPolicy rules.
If two (or more) policies with the same priority could both match a connection,
then the implementation can apply any of the matching policies to the
connection, and there is no way for the user to reliably determine which one it
will choose. Administrators must be careful about assigning the priorities for
policies with rules that will match many connections, and ensure that policies
have unique priority values in cases where ambiguity would be unacceptable.
Priority is a value from 0 to 1000. Policies with lower
numeric priority values have higher precedence, and are
checked before policies with higher numeric priority
values. All AdminNetworkPolicy rules have higher precedence
than NetworkPolicy or BaselineAdminNetworkPolicy rules.

If two (or more) policies with equal priority match the
same traffic, then any one (and only one) of the policies
will be applied to the traffic. There is no way for the
user to reliably determine which policy will be applied.

Administrators should use different priorities numbers if
non-deterministic matching between overlapping policies is a
problem.
format: int32
maximum: 1000
minimum: 0
Expand Down
Loading