@@ -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----
8784apiVersion: metallb.io/v1beta1
8885kind: IPAddressPool
8986metadata:
90- name: <ip _address_pool_name > <1>
9187 namespace: metallb
88+ name: <ip_address_pool_name> <1>
9289spec:
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+ ----
98110apiVersion: metallb.io/v1beta1
99- kind: BGPAdvertisement
111+ kind: L2Advertisement
100112metadata:
101- name: <bgp _advertisement_name > <3 >
113+ name: <l2_advertisement_name > <1 >
102114 namespace: metallb
103115spec:
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.
0 commit comments