Mirantis Container Cloud (MCC) becomes part of Mirantis OpenStack for Kubernetes (MOSK)!
Now, the MOSK documentation set covers all product layers, including MOSK management (formerly Container Cloud). This means everything you need is in one place. Some legacy names may remain in the code and documentation and will be updated in future releases. The separate Container Cloud documentation site will be retired, so please update your bookmarks for continued easy access to the latest content.
Update the Keycloak IP address on bare metal clusters¶
The following instruction describes how to update the IP address of the Keycloak service on 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 management cluster:
Log in to a node that contains
kubeconfigof the required management cluster.Make sure that the configuration file is in your
.kubedirectory. Otherwise, set theKUBECONFIGenvironment variable with a full path to the configuration file.Configure the additional
externalIP address pool for themetallbload balancer service.The Keycloak service requires one IP address. Therefore, the
externalIP address pool must contain at least one IP address.Open the
MetalLBConfigobject of the management cluster for editing:kubectl edit metallbconfig <MetalLBConfigName>
In the
ipAddressPoolssection, add:... spec: ipAddressPools: - name: external spec: addresses: - <pool_start_ip>-<pool_end_ip> autoAssign: false avoidBuggyIPs: false ...
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
externalIP address pool name to theL2Advertisementsdefinition. You can add it to the same L2 advertisement as thedefaultIP address pool, or create a new L2 advertisement if required.... spec: l2Advertisements: - name: default spec: interfaces: - k8s-lcm ipAddressPools: - default - external ...
Save and exit the object to apply changes.
Obtain the current Keycloak IP address for reference:
kubectl -n kaas get service iam-keycloak-http -o jsonpath='{.status.loadBalancer.ingress[0].ip}{"\n"}'
Configure the
iam-keycloak-httpservice to listen on one of the IP addresses from theexternalpool:kubectl -n kaas edit service iam-keycloak-http
Add the following annotation to the service:
kind: Service metadata: annotations: metallb.universe.tf/address-pool: external
Save and exit to apply changes.
Verify that the Keycloak service IP address has changed:
kubectl -n kaas get service iam-keycloak-http -o jsonpath='{.status.loadBalancer.ingress[0].ip}{"\n"}'
Monitor the cluster status to verify that the changes are applied:
kubectl get cluster kaas-mgmt -o yaml
In the output, monitor the
urlparameter value in thekeycloakfield:... status: providerStatus: helm: ready: true ... releases: ... iam: keycloak: url: https://<pool_start_ip>
The value of the parameter is typically the first address of the
externalpool rage.Once the parameter has updated, delete the old certificate for the former address:
kubectl delete secret keycloak-tls-certs -n kaas
Note
The new certificate secret with the same name
keycloak-tls-certswill be generated automatically.Verify the new certificate, once available:
kubectl get secret keycloak-tls-certs -n kaas -o yaml
Restart the
iam-keycloak-httppod to ensure that the new certificate is used:Change the number of the
iam-keycloakStatefulSetreplicas to0:kubectl -n kaas scale statefulsets iam-keycloak --replicas=0
Wait until the
READYcolumn has0/0pods:kubectl -n kaas get statefulsets iam-keycloak
Change the number of the
iam-keycloakStatefulSetreplicas back to 3:kubectl -n kaas scale statefulsets iam-keycloak --replicas=3
Wait until the
READYcolumn has at least1/3pods:kubectl -n kaas get statefulsets iam-keycloak
Verify that the IP address in the
status.providerStatus.oidc.issuerUrlfield of theClusterobject has changed:kubectl get cluster kaas-mgmt -o jsonpath='{.status.providerStatus.oidc.issuerUrl}{"\n"}'
If it still contains the old IP address, update it manually:
kubectl edit cluster kaas-mgmt
Under
spec.providerSpec.value.kaas.management.helmReleases, update thevalues.api.keycloak.urlfield inside theiamHelm object definition:spec: providerSpec: value: kaas: management: helmReleases: - name: iam values: api: keycloak: url: https://<newKeycloakServiceIpAddress>
Save and exit to apply changes.
Wait a few minutes until
issuerUrlis changed and OIDC is ready.To verify
issuerUrl:kubectl get cluster kaas-mgmt -o jsonpath='{.status.providerStatus.oidc.issuerUrl}{"\n"}'
To verify OIDC readiness:
kubectl get cluster kaas-mgmt -o jsonpath='{.status.providerStatus.oidc.ready}{"\n"}'
Verify that the MOSK management console and MKE web UI are accessible with the new Keycloak IP address and certificate.