mirror of
https://github.com/openshift/openshift-docs.git
synced 2026-02-05 12:46:18 +01:00
73 lines
1.8 KiB
Plaintext
73 lines
1.8 KiB
Plaintext
:_mod-docs-content-type: PROCEDURE
|
|
[id="nw-metallb-configure-address-pool_{context}"]
|
|
= Configuring an address pool
|
|
|
|
[role="_abstract"]
|
|
To precisely manage external access to application workloads, configure MetalLB address pools for your cluster. By defining these pools, you can control the specific IP address ranges assigned to load balancer services for consistent network routing.
|
|
|
|
.Prerequisites
|
|
|
|
* Install the {oc-first}.
|
|
* Log in as a user with `cluster-admin` privileges.
|
|
|
|
.Procedure
|
|
|
|
. Create a file, such as `ipaddresspool.yaml`, with content like the following example:
|
|
+
|
|
[source,yaml]
|
|
----
|
|
apiVersion: metallb.io/v1beta1
|
|
kind: IPAddressPool
|
|
metadata:
|
|
namespace: metallb-system
|
|
name: doc-example
|
|
labels:
|
|
zone: east
|
|
spec:
|
|
addresses:
|
|
- 203.0.113.1-203.0.113.10
|
|
- 203.0.113.65-203.0.113.75
|
|
# ...
|
|
----
|
|
+
|
|
where:
|
|
+
|
|
`labels`:: The label assigned to the `IPAddressPool` can be referenced by the `ipAddressPoolSelectors` in the `BGPAdvertisement` CRD to associate the `IPAddressPool` with the advertisement.
|
|
|
|
. Apply the configuration for the IP address pool by entering the following command:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ oc apply -f ipaddresspool.yaml
|
|
----
|
|
|
|
.Verification
|
|
|
|
. View the address pool by entering the following command:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ oc describe -n metallb-system IPAddressPool doc-example
|
|
----
|
|
+
|
|
.Example output
|
|
[source,terminal]
|
|
----
|
|
Name: doc-example
|
|
Namespace: metallb-system
|
|
Labels: zone=east
|
|
Annotations: <none>
|
|
API Version: metallb.io/v1beta1
|
|
Kind: IPAddressPool
|
|
Metadata:
|
|
...
|
|
Spec:
|
|
Addresses:
|
|
203.0.113.1-203.0.113.10
|
|
203.0.113.65-203.0.113.75
|
|
Auto Assign: true
|
|
Events: <none>
|
|
----
|
|
|
|
. Confirm that the address pool name, such as `doc-example`, and the IP address ranges exist in the output.
|