Skip to content

Commit a5ee6a9

Browse files
authored
Merge pull request #50131 from rohennes/TELCODOCS-422-ip-pool-node-subset
2 parents 95cebb1 + 0e60f31 commit a5ee6a9

File tree

4 files changed

+56
-6
lines changed

4 files changed

+56
-6
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * networking/metallb/about-advertising-ipaddresspool.adoc
4+
5+
:_content-type: PROCEDURE
6+
7+
[id="nw-metallb-advertise-ip-pools-to-node-subset_{context}"]
8+
= Advertising an IP address pool from a subset of nodes
9+
10+
To advertise an IP address from an IP addresses pool, from a specific set of nodes only, use the `.spec.nodeSelector` specification in the BGPAdvertisement custom resource. This specification associates a pool of IP addresses with a set of nodes in the cluster. This is useful when you have nodes on different subnets in a cluster and you want to advertise an IP addresses from an address pool from a specific subnet, for example a public-facing subnet only.
11+
12+
.Prerequisites
13+
14+
* Install the OpenShift CLI (`oc`).
15+
* Log in as a user with `cluster-admin` privileges.
16+
17+
.Procedure
18+
19+
. Create an IP address pool by using a custom resource:
20+
+
21+
[source,yaml]
22+
----
23+
apiVersion: metallb.io/v1beta1
24+
kind: IPAddressPool
25+
metadata:
26+
namespace: metallb-system
27+
name: pool1
28+
spec:
29+
addresses:
30+
- 4.4.4.100-4.4.4.200
31+
- 2001:100:4::200-2001:100:4::400
32+
----
33+
34+
. Control which nodes in the cluster the IP address from `pool1` advertises from by defining the `.spec.nodeSelector` value in the BGPAdvertisement custom resource:
35+
+
36+
[source,yaml]
37+
----
38+
apiVersion: metallb.io/v1beta1
39+
kind: BGPAdvertisement
40+
metadata:
41+
name: example
42+
spec:
43+
ipAddressPools:
44+
- pool1
45+
nodeSelector:
46+
- matchLabels:
47+
kubernetes.io/hostname: NodeA
48+
- matchLabels:
49+
kubernetes.io/hostname: NodeB
50+
----
51+
52+
In this example, the IP address from `pool1` advertises from `NodeA` and `NodeB` only.

modules/nw-metallb-bgpadvertisement-cr.adoc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,6 @@ This BGP attribute applies to BGP sessions within the Autonomous System.
6767
|`spec.nodeSelectors`
6868
|`string`
6969
|Optional: `NodeSelectors` allows to limit the nodes to announce as next hops for the load balancer IP. When empty, all the nodes are announced as next hops.
70-
[NOTE]
71-
====
72-
The functionality this supports is Technology Preview only. Technology Preview features are not supported with Red Hat production service level agreements (SLAs) and might not be functionally complete. Red Hat does not recommend using them in production.
73-
====
7470

7571
|`spec.peers`
7672
|`string`

modules/nw-metallb-l2padvertisement-cr.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Specify the same namespace that the MetalLB Operator uses.
4040
[NOTE]
4141
====
4242
Limiting the nodes to announce as next hops is Technology Preview only. For more information about Technology Preview support, see link:https://access.redhat.com/support/offerings/techpreview/[Technology Preview Features Support Scope].
43-
]
43+
4444
====
4545

4646
|===

networking/metallb/about-advertising-ipaddresspool.adoc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,11 @@ include::modules/nw-metallb-advertise-address-pool-with-bgp.adoc[leveloffset=+2]
2626
include::modules/nw-metallb-configure-bgp-advertisement-advanced.adoc[leveloffset=+1]
2727

2828
// Advertise MetalLB with a BGP advertisement
29-
3029
include::modules/nw-metallb-advertise-address-pool-with-bgp-advanced.adoc[leveloffset=+2]
3130

31+
// Advertise IP address pools from a subset of nodes
32+
include::modules/nw-metallb-advertise-ip-pools-from-node-subset.adoc[leveloffset=+1]
33+
3234
// L2 advertisement custom resource
3335
include::modules/nw-metallb-l2padvertisement-cr.adoc[leveloffset=+1]
3436

0 commit comments

Comments
 (0)