You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: modules/nw-egressnetworkpolicy-about.adoc
+1-5Lines changed: 1 addition & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,11 +46,7 @@ endif::ovn[]
46
46
47
47
[IMPORTANT]
48
48
====
49
-
If your egress firewall includes a deny rule for `0.0.0.0/0`, access to your {product-title} API servers is blocked. You must include the IP address range that the API servers listen on in your egress firewall rules.
50
-
51
-
ifdef::ovn[]
52
-
If you use the OVN-Kubernetes network plugin, you must include the built-in join network `100.64.0.0/16` to allow access when using node ports together with an egress firewall. If you changed this join network during cluster installation, use the value that you specified instead of `100.64.0.0/16`.
53
-
endif::ovn[]
49
+
If your egress firewall includes a deny rule for `0.0.0.0/0`, access to your {product-title} API servers is blocked. You must either add allow rules for each IP address or use the `nodeSelector` type allow rule in your egress policy rules to connect to API servers.
54
50
55
51
The following example illustrates the order of the egress firewall rules necessary to ensure API server access:
Copy file name to clipboardExpand all lines: modules/nw-egressnetworkpolicy-object.adoc
+30-3Lines changed: 30 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,7 +49,7 @@ endif::ovn[]
49
49
[id="egressnetworkpolicy-rules_{context}"]
50
50
== {kind} rules
51
51
52
-
The following YAML describes an egress firewall rule object. The `egress` stanza expects an array of one or more objects.
52
+
The following YAML describes an egress firewall rule object. The user can select either an IP address range in CIDR format, a domain name, or use the `nodeSelector` to allow or deny egress traffic. The `egress` stanza expects an array of one or more objects.
53
53
54
54
// - OVN-Kubernetes does not support DNS
55
55
// - OpenShift SDN does not support port and protocol specification
@@ -77,14 +77,16 @@ egress:
77
77
to: <2>
78
78
cidrSelector: <cidr> <3>
79
79
dnsName: <dns_name> <4>
80
-
ports: <5>
80
+
nodeSelector: <label_name>: <label_value> <5>
81
+
ports: <6>
81
82
...
82
83
----
83
84
<1> The type of rule. The value must be either `Allow` or `Deny`.
84
85
<2> A stanza describing an egress traffic match rule that specifies the `cidrSelector` field or the `dnsName` field. You cannot use both fields in the same rule.
85
86
<3> An IP address range in CIDR format.
86
87
<4> A DNS domain name.
87
-
<5> Optional: A stanza describing a collection of network ports and protocols for the rule.
88
+
<5> Labels are key/value pairs that the user defines. Labels are attached to objects, such as pods. The `nodeSelector` allows for one or more node labels to be selected and attached to pods.
89
+
<6> Optional: A stanza describing a collection of network ports and protocols for the rule.
88
90
89
91
.Ports stanza
90
92
[source,yaml]
@@ -143,6 +145,31 @@ spec:
143
145
protocol: TCP
144
146
- port: 443
145
147
----
148
+
149
+
[id="configuringNodeSelector-example_{context}"]
150
+
== Example nodeSelector for {kind}
151
+
152
+
As a cluster administrator, you can allow or deny egress traffic to nodes in your cluster by specifying a label using `nodeSelector`. Labels can be applied to one or more nodes. The following is an example with the `region=east` label:
153
+
154
+
[source,yaml]
155
+
----
156
+
apiVersion: v1
157
+
kind: Pod
158
+
metadata:
159
+
name: default
160
+
spec:
161
+
egress:
162
+
- to:
163
+
nodeSelector:
164
+
matchLabels:
165
+
region: east
166
+
type: Allow
167
+
----
168
+
169
+
[TIP]
170
+
====
171
+
Instead of adding manual rules per node IP address, use node selectors to create a label that allows pods behind an egress firewall to access host network pods.
0 commit comments