Chapter 6. Configuring Capsule Servers with custom SSL certificates for load balancing (with Puppet)
You can configure one or more Capsule Servers that use custom SSL certificates for load balancing.
6.1. Prerequisites Copy linkLink copied to clipboard!
- Prepare a new Capsule Server to use for load balancing. See Chapter 2, Preparing Capsule Servers for load balancing.
- Review Section 1.2, “Services and features supported in a load-balanced setup”.
6.2. Creating a custom SSL certificate for Capsule Server Copy linkLink copied to clipboard!
On each Capsule Server you want to configure for load balancing, create a configuration file for the Certificate Signing Request and include the load balancer and Capsule Server as Subject Alternative Names (SAN).
Procedure
To store all the source certificate files, create a directory that is accessible only to the
rootuser:mkdir /root/capsule_cert
# mkdir /root/capsule_certCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create a private key with which to sign the certificate signing request (CSR).
Note that the private key must be unencrypted. If you use a password-protected private key, remove the private key password.
If you already have a private key for this Capsule Server, skip this step.
openssl genrsa -out /root/capsule_cert/capsule_cert_key.pem 4096
# openssl genrsa -out /root/capsule_cert/capsule_cert_key.pem 4096Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create the
/root/capsule_cert/openssl.cnfconfiguration file for the CSR and include the following content:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- The certificate’s common name must match the FQDN of Capsule Server. Ensure to change this when running the command on each Capsule Server that you configure for load balancing. You can also set a wildcard value
*. If you set a wildcard value, you must add the-t capsuleoption when you use thekatello-certs-checkcommand. - 2
- Under
[alt_names], include the FQDN of the load balancer asDNS.1and the FQDN of Capsule Server asDNS.2.
For more information about the
[ v3_req ]parameters and their purpose, see RFC 5280: Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile.Optional: If you want to add Distinguished Name (DN) details to the CSR, add the following information to the
[ req_distinguished_name ]section:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Generate CSR:
openssl req -new \ -key /root/capsule_cert/capsule_cert_key.pem \ -config /root/capsule_cert/openssl.cnf \ -out /root/capsule_cert/capsule_cert_csr.pem
# openssl req -new \ -key /root/capsule_cert/capsule_cert_key.pem \1 -config /root/capsule_cert/openssl.cnf \2 -out /root/capsule_cert/capsule_cert_csr.pem3 Copy to Clipboard Copied! Toggle word wrap Toggle overflow Send the certificate signing request to the certificate authority (CA). The same CA must sign certificates for Satellite Server and Capsule Server.
When you submit the request, specify the lifespan of the certificate. The method for sending the certificate request varies, so consult the CA for the preferred method. In response to the request, you can expect to receive a CA bundle and a signed certificate, in separate files.
- Copy the Certificate Authority bundle and Capsule Server certificate file that you receive from the Certificate Authority, and Capsule Server private key to your Satellite Server.
On Satellite Server, validate Capsule Server certificate input files:
katello-certs-check \ -c /root/capsule_cert/capsule_cert.pem \ -k /root/capsule_cert/capsule_cert_key.pem \ -b /root/capsule_cert/ca_cert_bundle.pem
# katello-certs-check \ -c /root/capsule_cert/capsule_cert.pem \1 -k /root/capsule_cert/capsule_cert_key.pem \2 -b /root/capsule_cert/ca_cert_bundle.pem3 Copy to Clipboard Copied! Toggle word wrap Toggle overflow If you set the
commonName=to a wildcard value*, you must add the-t capsuleoption to thekatello-certs-checkcommand.Retain a copy of the example
capsule-certs-generatecommand that is output by thekatello-certs-checkcommand for creating the Certificate Archive File for this Capsule Server.
6.3. Configuring Capsule Server with custom SSL certificates to generate and sign Puppet certificates Copy linkLink copied to clipboard!
On the Capsule Server that will generate Puppet certificates for all other load-balancing Capsule Servers, configure Puppet certificate generation and signing.
Procedure
Append the following option to the
capsule-certs-generatecommand that you obtain from the output of thekatello-certs-checkcommand:--foreman-proxy-cname loadbalancer.example.com
--foreman-proxy-cname loadbalancer.example.comCopy to Clipboard Copied! Toggle word wrap Toggle overflow On Satellite Server, enter the
capsule-certs-generatecommand to generate Capsule certificates:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Retain a copy of the example
satellite-installercommand from the output for installing Capsule Server certificates.- Copy the certificate archive file from Satellite Server to Capsule Server.
Append the following options to the
satellite-installercommand that you obtain from the output of thecapsule-certs-generatecommand:--enable-foreman-proxy-plugin-remote-execution-script \ --foreman-proxy-puppetca "true" \ --puppet-ca-server "capsule-ca.example.com" \ --puppet-dns-alt-names "loadbalancer.example.com" \ --puppet-server-ca "true"
--enable-foreman-proxy-plugin-remote-execution-script \ --foreman-proxy-puppetca "true" \ --puppet-ca-server "capsule-ca.example.com" \ --puppet-dns-alt-names "loadbalancer.example.com" \ --puppet-server-ca "true"Copy to Clipboard Copied! Toggle word wrap Toggle overflow On Capsule Server, enter the
satellite-installercommand:Copy to Clipboard Copied! Toggle word wrap Toggle overflow On Capsule Server that is the Puppetserver Certificate Authority, stop the Puppet server:
systemctl stop puppetserver
# systemctl stop puppetserverCopy to Clipboard Copied! Toggle word wrap Toggle overflow Generate Puppet certificates for all other Capsule Servers that you configure for load balancing, except the system where you first configured Puppet certificate signing:
puppetserver ca generate \ --ca-client \ --certname capsule.example.com \ --subject-alt-names loadbalancer.example.com
# puppetserver ca generate \ --ca-client \ --certname capsule.example.com \ --subject-alt-names loadbalancer.example.comCopy to Clipboard Copied! Toggle word wrap Toggle overflow This command creates the following files:
-
/etc/puppetlabs/puppet/ssl/certs/capsule.example.com.pem -
/etc/puppetlabs/puppet/ssl/private_keys/capsule.example.com.pem -
/etc/puppetlabs/puppet/ssl/public_keys/capsule.example.com.pem -
/etc/puppetlabs/puppetserver/ca/signed/capsule.example.com.pem
-
Start the Puppet server:
systemctl start puppetserver
# systemctl start puppetserverCopy to Clipboard Copied! Toggle word wrap Toggle overflow
6.4. Configuring remaining Capsule Servers with custom SSL certificates for load balancing Copy linkLink copied to clipboard!
On each load-balancing Capsule Server, excluding the Capsule Server configured to sign Puppet certificates, configure the system to use Puppet certificates.
Procedure
Append the following option to the
capsule-certs-generatecommand that you obtain from the output of thekatello-certs-checkcommand:--foreman-proxy-cname loadbalancer.example.com
--foreman-proxy-cname loadbalancer.example.comCopy to Clipboard Copied! Toggle word wrap Toggle overflow On Satellite Server, enter the
capsule-certs-generatecommand to generate Capsule certificates:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Retain a copy of the example
satellite-installercommand from the output for installing Capsule Server certificates.Copy the certificate archive file from Satellite Server to Capsule Server.
scp /root/capsule.example.com-certs.tar root@capsule.example.com:capsule.example.com-certs.tar
# scp /root/capsule.example.com-certs.tar root@capsule.example.com:capsule.example.com-certs.tarCopy to Clipboard Copied! Toggle word wrap Toggle overflow On Capsule Server, install the
puppetserverpackage:satellite-maintain packages install puppetserver
# satellite-maintain packages install puppetserverCopy to Clipboard Copied! Toggle word wrap Toggle overflow On Capsule Server, create directories for puppet certificates:
mkdir -p /etc/puppetlabs/puppet/ssl/certs/ \ /etc/puppetlabs/puppet/ssl/private_keys/ \ /etc/puppetlabs/puppet/ssl/public_keys/
# mkdir -p /etc/puppetlabs/puppet/ssl/certs/ \ /etc/puppetlabs/puppet/ssl/private_keys/ \ /etc/puppetlabs/puppet/ssl/public_keys/Copy to Clipboard Copied! Toggle word wrap Toggle overflow On Capsule Server, copy the Puppet certificates for this Capsule Server from the system where you configure Capsule Server to sign Puppet certificates:
scp root@capsule-ca.example.com:/etc/puppetlabs/puppet/ssl/certs/capsule.example.com.pem /etc/puppetlabs/puppet/ssl/certs/capsule.example.com.pem scp root@capsule-ca.example.com:/etc/puppetlabs/puppet/ssl/certs/ca.pem /etc/puppetlabs/puppet/ssl/certs/ca.pem scp root@capsule-ca.example.com:/etc/puppetlabs/puppet/ssl/private_keys/capsule.example.com.pem /etc/puppetlabs/puppet/ssl/private_keys/capsule.example.com.pem scp root@capsule-ca.example.com:/etc/puppetlabs/puppet/ssl/public_keys/capsule.example.com.pem /etc/puppetlabs/puppet/ssl/public_keys/capsule.example.com.pem
# scp root@capsule-ca.example.com:/etc/puppetlabs/puppet/ssl/certs/capsule.example.com.pem /etc/puppetlabs/puppet/ssl/certs/capsule.example.com.pem # scp root@capsule-ca.example.com:/etc/puppetlabs/puppet/ssl/certs/ca.pem /etc/puppetlabs/puppet/ssl/certs/ca.pem # scp root@capsule-ca.example.com:/etc/puppetlabs/puppet/ssl/private_keys/capsule.example.com.pem /etc/puppetlabs/puppet/ssl/private_keys/capsule.example.com.pem # scp root@capsule-ca.example.com:/etc/puppetlabs/puppet/ssl/public_keys/capsule.example.com.pem /etc/puppetlabs/puppet/ssl/public_keys/capsule.example.com.pemCopy to Clipboard Copied! Toggle word wrap Toggle overflow On Capsule Server, change the
/etc/puppetlabs/puppet/ssl/directory ownership to userpuppetand grouppuppet:chown -R puppet:puppet /etc/puppetlabs/puppet/ssl/
# chown -R puppet:puppet /etc/puppetlabs/puppet/ssl/Copy to Clipboard Copied! Toggle word wrap Toggle overflow On Capsule Server, set the SELinux context for the
/etc/puppetlabs/puppet/ssl/directory:restorecon -Rv /etc/puppetlabs/puppet/ssl/
# restorecon -Rv /etc/puppetlabs/puppet/ssl/Copy to Clipboard Copied! Toggle word wrap Toggle overflow Append the following options to the
satellite-installercommand that you obtain from the output of thecapsule-certs-generatecommand:Copy to Clipboard Copied! Toggle word wrap Toggle overflow On Capsule Server, enter the
satellite-installercommand:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
6.5. Managing Puppet limitations with load balancing in Satellite Copy linkLink copied to clipboard!
If you use Puppet, Puppet certificate signing is assigned to the first Capsule that you configure. If the first Capsule is down, hosts cannot obtain Puppet content.
Puppet Certificate Authority (CA) management does not support certificate signing in a load-balanced setup. Puppet CA stores certificate information, such as the serial number counter and CRL, on the file system. Multiple writer processes that attempt to use the same data can corrupt it.
To manage this Puppet limitation, complete the following steps:
- Configure Puppet certificate signing on one Capsule Server, typically the first system where you configure Capsule Server for load balancing.
- Configure the clients to send CA requests to port 8141 on a load balancer.
- Configure a load balancer to redirect CA requests from port 8141 to port 8140 on the system where you configure Capsule Server to sign Puppet certificates.
To troubleshoot issues, reproduce the issue on each Capsule, bypassing the load balancer. This solution does not use Pacemaker or other similar HA tools to maintain one state across all Capsules.