Update the Keycloak IP address on bare metal clusters¶
The following instruction describes how to update the IP address of the
Keycloak service on baremetal-based management clusters.
Note
The commands below contain the default kaas-mgmt name of the
management cluster. If you changed the default name,
replace it accordingly. To verify the cluster name, run
kubectl get clusters.
To update the Keycloak IP address on a bare metal management cluster:
Log in to a node that contains kubeconfig of the required
management cluster.
Make sure that the configuration file is in your .kube directory.
Otherwise, set the KUBECONFIG environment variable
with a full path to the configuration file.
Configure the additional external IP address pool for the
metallb load balancer service.
The Keycloak service requires one IP address. Therefore, the external
IP address pool must contain at least one IP address.
Since Container Cloud 2.27.0
Open the MetalLBConfig object of the management cluster for editing:
In the snippet above, replace the following parameters:
<pool_start_ip> - first IP address in the required range
<pool_end_ip> - last IP address in the range
Add the external IP address pool name to the L2Advertisements
definition. You can add it to the same L2 advertisement as the
default IP address pool, or create a new L2 advertisement
if required.
The kaas.mirantis.com/region label is removed from all
Container Cloud objects in 2.26.0 (Cluster releases 17.1.0 and 16.1.0).
Therefore, do not add the label starting these releases. On existing
clusters updated to these releases, or if manually added, this label will
be ignored by Container Cloud.
In the template above, replace the following parameters:
<pool_start_ip> - first IP address in the desired range.
<pool_end_ip> - last IP address in the range.
<pool_cidr> - corresponding CIDR address. The only requirement
for this CIDR address is that the address range mentioned above
must fit into this CIDR. The CIDR address is not used by MetalLB,
it is just formally required for Subnet objects.
Note
If required, use a different IP address pool name.
Apply the Subnet template created in the previous step:
kubectlcreate-f<subnetTemplateName>
Open the MetalLBConfigTemplate object of the management cluster
for editing:
kubectledit<MetalLBConfigTemplateName>
Add the external IP address pool name to the L2Advertisements
definition. You can add it to the same L2 advertisement as the
default IP address pool, or create a new L2 advertisement
if required.
Add the following highlighted lines by replacing <pool_start_ip>
with the first IP address in the desired range and <pool_end_ip>
with the last IP address in the range:
spec:providerSpec:value:helmReleases:-name:metallbvalues:configInline:address-pools:-name:defaultprotocol:layer2addresses:-10.0.0.100-10.0.0.120 // example values-name:externalprotocol:layer2auto-assign:falseaddresses:-<pool_start_ip>-<pool_end_ip>
Note
If required, use a different IP address pool name.
Save and exit the object to apply changes.
Obtain the current Keycloak IP address for reference: