Skip to content

Commit b375812

Browse files
committed
OCPBUGS#44365: Hosted control planes: Configure layer2 and BGP using metallb
1 parent a561690 commit b375812

File tree

2 files changed

+31
-23
lines changed

2 files changed

+31
-23
lines changed

modules/hcp-bm-ingress.adoc

Lines changed: 30 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -75,47 +75,55 @@ metadata:
7575
$ oc apply -f metallb-instance-config.yaml
7676
----
7777

78-
. Configure the MetalLB Operator by creating two resources:
79-
+
80-
** An `IPAddressPool` resource with a single IP address. This IP address must be on the same subnet as the network that the cluster nodes use.
81-
** A `BGPAdvertisement` resource to advertise the load balancer IP addresses that the `IPAddressPool` resource provides through the BGP protocol.
82-
+
83-
.. Create a YAML file to contain the configuration:
78+
. Create an `IPAddressPool` resource with a single IP address. This IP address must be on the same subnet as the network that the cluster nodes use.
79+
80+
.. Create a file, such as `ipaddresspool.yaml`, with content like the following example:
8481
+
8582
[source,yaml]
8683
----
8784
apiVersion: metallb.io/v1beta1
8885
kind: IPAddressPool
8986
metadata:
90-
name: <ip_address_pool_name> <1>
9187
namespace: metallb
88+
name: <ip_address_pool_name> <1>
9289
spec:
93-
protocol: layer2
94-
autoAssign: false
9590
addresses:
9691
- <ingress_ip>-<ingress_ip> <2>
97-
---
92+
autoAssign: false
93+
----
94+
<1> Specify the `IPAddressPool` resource name.
95+
<2> Specify the IP address for your environment. For example, `192.168.122.23`.
96+
97+
.. Apply the configuration for the IP address pool by entering the following command:
98+
+
99+
[source,terminal]
100+
----
101+
$ oc apply -f ipaddresspool.yaml
102+
----
103+
104+
. Create a L2 advertisement.
105+
106+
.. Create a file, such as `l2advertisement.yaml`, with content like the following example:
107+
+
108+
[source,yaml]
109+
----
98110
apiVersion: metallb.io/v1beta1
99-
kind: BGPAdvertisement
111+
kind: L2Advertisement
100112
metadata:
101-
name: <bgp_advertisement_name> <3>
113+
name: <l2_advertisement_name> <1>
102114
namespace: metallb
103115
spec:
104116
ipAddressPools:
105-
- <ip_address_pool_name> <1>
117+
- <ip_address_pool_name> <2>
106118
----
107-
+
108-
<1> Specify the `IPAddressPool` resource name.
109-
<2> Specify the IP address for your environment, for example, `192.168.122.23`.
110-
<3> Specify the `BGPAdvertisement` resource name.
111-
+
112-
.. Save the file as `ipaddresspool-bgpadvertisement-config.yaml`.
113-
+
114-
.. Create the resources by entering the following command:
119+
<1> Specify the `L2Advertisement` resource name.
120+
<2> Specify the `IPAddressPool` resource name.
121+
122+
.. Apply the configuration by entering the following command:
115123
+
116124
[source,terminal]
117125
----
118-
$ oc apply -f ipaddresspool-bgpadvertisement-config.yaml
126+
$ oc apply -f l2advertisement.yaml
119127
----
120128

121129
. After creating a service of the `LoadBalancer` type, MetalLB adds an external IP address for the service.

modules/hcp-metallb.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,4 +90,4 @@ $ oc apply -f l2advertisement.yaml
9090
[source,terminal]
9191
----
9292
l2advertisement.metallb.io/metallb created
93-
----
93+
----

0 commit comments

Comments
 (0)