Connect a public IP address to the load balancer
If you use a load balancer to work with a Managed Kubernetes cluster, by default the load balancer is created on the same network as the cluster nodes and is assigned a public IP address. To create a load balancer without a public IP address or with an IP address from other subnets, use the Configure a load balancer instructions in the Managed Kubernetes section. For the load balancer to work correctly in a cluster, all actions with the load balancer must be performed via kubectl.
Connect a public IP address to the load balancer
A static public IP address can be connected when creating a balancer or to an already created balancer.
Control panel
OpenStack CLI
- Make sure that the load balancer is on a subnet that meets the requirements, see Prepare a private subnet to connect a public IP address in the Public IP Addresses instruction for details. You can view the subnets of the load balancer in the control panel: in the top menu, click Products → Cloud Servers → Balancers → Balancers tab → Balancers page → Balancer page → Settings block → Network field.
- In the dashboard, on the top menu, click Products and select Cloud Servers.
- Go to Balancers → Balancers tab.
- In the balancer card, click Connect Public IP.
- Select a public IP address.
- Click Connect.
-
Copy the port ID of the balancer, to do this output the balancer information:
openstack loadbalancer show <loadbalancer>
Specify
<loadbalancer>
— balancer ID or name. The list can be viewed using theopenstack loadbalancer list
command.In the command output, copy the value from the
vip_port_id
field. -
Connect the public IP address to the load balancer port:
openstack floating ip set --port <port> <public_ip_address>
Specify:
<port>
— The port ID of the load balancer port that you copied in step 2;<public_ip_address>
— ID, or public IP address, can be viewed with the commandopenstack floating ip list
.
Disconnect the public IP address from the load balancer
Control panel
OpenStack CLI
- In the dashboard, on the top menu, click Products and select Cloud Servers.
- Go to Balancers → Balancers tab.
- In the balancer card of the public IP address, click .
- Select Disable public IP address.
- Click Save.
-
Disconnect the public IP address from the load balancer port:
openstack floating ip unset --port <public_ip_address>
Specify
<public_ip_address>
— ID or public IP address, can be viewed using theopenstack floating ip list
command.