@@ -120,13 +120,13 @@ type PortRange struct {
120120 End int32 `json:"end"`
121121}
122122
123- // AdminNetworkPolicyPeer defines an in-cluster peer to allow traffic to/ from.
123+ // AdminNetworkPolicyIngressPeer defines an in-cluster peer to allow traffic from.
124124// Exactly one of the selector pointers must be set for a given peer. If a
125125// consumer observes none of its fields are set, they must assume an unknown
126126// option has been specified and fail closed.
127127// +kubebuilder:validation:MaxProperties=1
128128// +kubebuilder:validation:MinProperties=1
129- type AdminNetworkPolicyPeer struct {
129+ type AdminNetworkPolicyIngressPeer struct {
130130 // Namespaces defines a way to select all pods within a set of Namespaces.
131131 // Note that host-networked pods are not included in this type of peer.
132132 //
@@ -135,7 +135,7 @@ type AdminNetworkPolicyPeer struct {
135135 // +optional
136136 Namespaces * NamespacedPeer `json:"namespaces,omitempty"`
137137 // Pods defines a way to select a set of pods in
138- // in a set of namespaces. Note that host-networked pods
138+ // a set of namespaces. Note that host-networked pods
139139 // are not included in this type of peer.
140140 //
141141 // Support: Core
@@ -144,6 +144,39 @@ type AdminNetworkPolicyPeer struct {
144144 Pods * NamespacedPodPeer `json:"pods,omitempty"`
145145}
146146
147+ // AdminNetworkPolicyEgressPeer defines a peer to allow traffic to.
148+ // Exactly one of the selector pointers must be set for a given peer. If a
149+ // consumer observes none of its fields are set, they must assume an unknown
150+ // option has been specified and fail closed.
151+ // +kubebuilder:validation:MaxProperties=1
152+ // +kubebuilder:validation:MinProperties=1
153+ type AdminNetworkPolicyEgressPeer struct {
154+ // Namespaces defines a way to select all pods within a set of Namespaces.
155+ // Note that host-networked pods are not included in this type of peer.
156+ //
157+ // Support: Core
158+ //
159+ // +optional
160+ Namespaces * NamespacedPeer `json:"namespaces,omitempty"`
161+ // Pods defines a way to select a set of pods in
162+ // a set of namespaces. Note that host-networked pods
163+ // are not included in this type of peer.
164+ //
165+ // Support: Core
166+ //
167+ // +optional
168+ Pods * NamespacedPodPeer `json:"pods,omitempty"`
169+ // Nodes defines a way to select a set of nodes in
170+ // the cluster. This field follows standard label selector
171+ // semantics; if present but empty, it selects all Nodes.
172+ //
173+ // Support: Extended
174+ //
175+ // <network-policy-api:experimental>
176+ // +optional
177+ Nodes * metav1.LabelSelector `json:"nodes,omitempty"`
178+ }
179+
147180// NamespacedPeer defines a flexible way to select Namespaces in a cluster.
148181// Exactly one of the selectors must be set. If a consumer observes none of
149182// its fields are set, they must assume an unknown option has been specified
0 commit comments