@@ -75,47 +75,55 @@ metadata:
75
75
$ oc apply -f metallb-instance-config.yaml
76
76
----
77
77
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:
84
81
+
85
82
[source,yaml]
86
83
----
87
84
apiVersion: metallb.io/v1beta1
88
85
kind: IPAddressPool
89
86
metadata:
90
- name: <ip _address_pool_name > <1>
91
87
namespace: metallb
88
+ name: <ip_address_pool_name> <1>
92
89
spec:
93
- protocol: layer2
94
- autoAssign: false
95
90
addresses:
96
91
- <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
+ ----
98
110
apiVersion: metallb.io/v1beta1
99
- kind: BGPAdvertisement
111
+ kind: L2Advertisement
100
112
metadata:
101
- name: <bgp _advertisement_name > <3 >
113
+ name: <l2_advertisement_name > <1 >
102
114
namespace: metallb
103
115
spec:
104
116
ipAddressPools:
105
- - <ip _address_pool_name > <1 >
117
+ - <ip_address_pool_name> <2 >
106
118
----
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:
115
123
+
116
124
[source,terminal]
117
125
----
118
- $ oc apply -f ipaddresspool-bgpadvertisement-config .yaml
126
+ $ oc apply -f l2advertisement .yaml
119
127
----
120
128
121
129
. After creating a service of the `LoadBalancer` type, MetalLB adds an external IP address for the service.
0 commit comments