@@ -151,11 +151,19 @@ should be allowed as ingress sources or egress destinations.
151
151
ingress sources or egress destinations.
152
152
153
153
** namespaceSelector** * and* ** podSelector** : A single ` to ` /` from ` entry that specifies both
154
- ` namespaceSelector ` and ` podSelector ` selects particular Pods within particular namespaces. Be
154
+ ` namespaceSelector ` and ` podSelector ` . It selects particular Pods within particular namespaces. Be
155
155
careful to use correct YAML syntax. For example:
156
156
157
157
``` yaml
158
158
...
159
+ egress :
160
+ - to :
161
+ - namespaceSelector :
162
+ matchLabels :
163
+ user : bob
164
+ podSelector :
165
+ matchLabels :
166
+ role : server
159
167
ingress :
160
168
- from :
161
169
- namespaceSelector :
@@ -167,11 +175,24 @@ careful to use correct YAML syntax. For example:
167
175
...
168
176
```
169
177
170
- This policy contains a single ` from ` element allowing connections from Pods with the label
171
- ` role=client ` in namespaces with the label ` user=alice ` . But the following policy is different:
178
+ This policy contains a single ` to ` and ` from ` element.
179
+ - The ` to ` element allows outgoing connections to Pods with the label
180
+ ` role=server ` , * and* in namespaces with the label ` user=bob ` .
181
+ - The ` from ` element allows incoming connections from Pods with the label
182
+ ` role=client ` , * and* in namespaces with the label ` user=alice ` .
183
+
184
+ But the following policy is different:
172
185
173
186
``` yaml
174
187
...
188
+ egress :
189
+ - to :
190
+ - namespaceSelector :
191
+ matchLabels :
192
+ user : bob
193
+ - podSelector :
194
+ matchLabels :
195
+ role : server
175
196
ingress :
176
197
- from :
177
198
- namespaceSelector :
@@ -183,7 +204,11 @@ This policy contains a single `from` element allowing connections from Pods with
183
204
...
184
205
```
185
206
186
- It contains two elements in the ` from ` array, and allows connections from Pods in the local
207
+ It contains two elements in the ` to ` and ` from ` array.
208
+ - The ` to ` array allows outgoing connections to Pods in the local
209
+ Namespace with the label ` role=server ` , * or* from any Pod in any namespace with the label
210
+ ` user=bob ` .
211
+ - The ` from ` array allows incoming connections from Pods in the local
187
212
Namespace with the label ` role=client ` , * or* from any Pod in any namespace with the label
188
213
` user=alice ` .
189
214
0 commit comments