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-egress-ips-about.adoc
+37-7Lines changed: 37 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -73,29 +73,60 @@ When a pod matches the selector for multiple `EgressIP` objects, there is no gua
73
73
[id="nw-egress-ips-node-architecture_{context}"]
74
74
== Architectural diagram of an egress IP address configuration
75
75
76
-
The following diagram depicts an egress IP address configuration. The diagram describes the relationship between three nodes in a cluster and four pods running on that cluster in two different namespaces.
76
+
The following diagram depicts an egress IP address configuration. The diagram describes four pods in two different namespaces running on three nodes in a cluster. The nodes are assigned IP addresses from the `192.168.126.0/18` CIDR block on the host network.
image::nw-egress-ips-diagram.svg[Architectural diagram for the egress IP feature.]
80
80
81
81
Both Node 1 and Node 3 are labeled with `k8s.ovn.org/egress-assignable: ""` and thus available for the assignment of egress IP addresses.
82
82
83
-
The following `EgressIP` object describes a configuration that selects all pods in the `namespace1` namespace, with the `192.168.126.10` and `192.168.126.102` egress IP addresses specified.
83
+
The dashed lines in the diagram depict the traffic flow from pod1, pod2, and pod3 traveling through the pod network to egress the cluster from Node 1 and Node 3. When an external service receives traffic from any of the pods selected by the example `EgressIP` object, the source IP address is either `192.168.126.10` or `192.168.126.102`.
84
+
85
+
The following resources from the diagram are illustrated in detail:
86
+
87
+
`Namespace` objects::
88
+
+
89
+
--
90
+
The namespaces are defined in the following manifest:
91
+
92
+
.Namespace objects
93
+
[source,yaml]
94
+
----
95
+
apiVersion: v1
96
+
kind: Namespace
97
+
metadata:
98
+
name: namespace1
99
+
labels:
100
+
env: prod
101
+
---
102
+
apiVersion: v1
103
+
kind: Namespace
104
+
metadata:
105
+
name: namespace2
106
+
labels:
107
+
env: prod
108
+
----
109
+
--
110
+
111
+
`EgressIP` object::
112
+
+
113
+
--
114
+
The following `EgressIP` object describes a configuration that selects all pods in any namespace with the `env` label set to `prod`. The egress IP addresses for the selected pods are `192.168.126.10` and `192.168.126.102`.
84
115
85
116
.`EgressIP` object
86
117
[source,yaml]
87
118
----
88
119
apiVersion: k8s.ovn.org/v1
89
120
kind: EgressIP
90
121
metadata:
91
-
name: egressips
122
+
name: egressips-prod
92
123
spec:
93
124
egressIPs:
94
125
- 192.168.126.10
95
126
- 192.168.126.102
96
127
namespaceSelector:
97
128
matchLabels:
98
-
name: namespace1
129
+
env: prod
99
130
status:
100
131
assignments:
101
132
- node: node1
@@ -104,9 +135,8 @@ status:
104
135
egressIP: 192.168.126.102
105
136
----
106
137
107
-
After creating the `EgressIP` object, {product-title} assigns both egress IP addresses to the available nodes. The `status` field reflects the whether and where the egress IP addresses are assigned.
108
-
109
-
The dashed lines in the diagram depict the traffic flow from `pod1`, `pod2`, and `pod3` traveling through the pod network to egress the cluster from Node 1 and Node 3. When an external service receives traffic from any of the pods selected by the example `EgressIP` object, the source IP address is either `192.168.126.10` or `192.168.126.102`.
138
+
For the configuration in the previous example, {product-title} assigns both egress IP addresses to the available nodes. The `status` field reflects whether and where the egress IP addresses are assigned.
Copy file name to clipboardExpand all lines: modules/nw-egress-ips-object.adoc
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,7 +36,7 @@ The following YAML describes the stanza for the namespace selector:
36
36
----
37
37
namespaceSelector: <1>
38
38
matchLabels:
39
-
name: <namespace_name>
39
+
<label_name>: <label_value>
40
40
----
41
41
<1> One or more matching rules for namespaces. If more than one match rule is provided, all matching namespaces are selected.
42
42
@@ -47,11 +47,11 @@ The following YAML describes the optional stanza for the pod selector:
47
47
----
48
48
podSelector: <1>
49
49
matchLabels:
50
-
name: <pod_name>
50
+
<label_name>: <label_value>
51
51
----
52
52
<1> Optional: One or more matching rules for pods in the namespaces that match the specified `namespaceSelector` rules. If specified, only pods that match are selected. Others pods in the namespace are not selected.
53
53
54
-
In the following example, the `EgressIP` object associates the `192.168.126.11` and `192.168.126.102` egress IP addresses with the pod that is named `my-pod` in the namespace that is named `my-namespace`:
54
+
In the following example, the `EgressIP` object associates the `192.168.126.11` and `192.168.126.102` egress IP addresses with pods that have the `app` label set to `web` and are in the namespaces that have the `env` label set to `prod`:
55
55
56
56
.Example `EgressIP` object
57
57
[source,yaml]
@@ -66,10 +66,10 @@ spec:
66
66
- 192.168.126.102
67
67
podSelector:
68
68
matchLabels:
69
-
name: my-pod
69
+
app: web
70
70
namespaceSelector:
71
71
matchLabels:
72
-
name: my-namespace
72
+
env: prod
73
73
----
74
74
75
75
In the following example, the `EgressIP` object associates the `192.168.127.30` and `192.168.127.40` egress IP addresses with any pods that do not have the `environment` label set to `development`:
0 commit comments