This is a blog with random OpenShift, Kubernetes, OpenStack and Linux related notes so I don't forget things.
If you find something inaccurate or that could be fixed, please file a bug report here.
Certificates for the undercloud's public endpoints using FreeIPA
by Juan Antonio Osorio Robles
TripleO’s undercloud has the option to auto-generate certificates for its
public endpoints (hopefully soon I’ll add the same option for the admin and
internal ones). This is based on certmonger. Being certmonger able to get
certificates from FreeIPA, we’ll do just that.
FreeIPA setup
It is assumed that you have FreeIPA running somewhere. Else, you can follow
this post by Adam Young to install it quickly, or you could
even use Heat to install it.
First of all, we need to register the undercloud node as a host in FreeIPA. For
this, we need an account that’s able to do this. So, making sure we have the
appropriate permissions and that we have a kerberos ticket that’s valid. We add
the host to FreeIPA as the following:
Remember to use your own domain here.
This will give you an output such as the following:
You might aso need an appropriate service for HAProxy in the undercloud. We can
add it with the following command:
Make sure that the hostname, the domain and the kerberos realm are
appropriate to your deployment. Once the aforementioned command was ran, you’ll
see output such as the following:
Once we have this ready, we need to log in the undercloud node and enroll it as
a FreeIPA client.
Undercloud enrollment to FreeIPA
Please note that we need to make sure we have access to the FreeIPA server node
from the undercloud. Also, the undercloud’s domain needs to match the kerberos
realm that FreeIPA manages. Finally, the undercloud’s FQDN must match the host
that was created in FreeIPA. So, with this in mind, we can do the enrollment:
Once this is done, in FreeIPA we can now see the following:
Noting that the OTP is no longer usable (Password: False) and the Keytab is set
to True, which means we have a keytab in that host that we can use for
authenticating.
Now, in the undercloud node, we need to get the kerberos ticket in order to be
able to request our certificate:
We can verify that we indeed have a kerberos ticket with the following command:
Which should give the output that resembles this:
Undercloud setup
Now we have everything we need. So for the undercloud to be able to request
certificates from FreeIPA, we need to add the following values to the
undercloud.conf file.
Having changed these values, we can run this to install or re-install the
undercloud:
Once this is done, we can verify that the public keystone endpoints are
listening on https like this:
Furtherly, we can check that certmonger is tracking the service certificate: