4.3. 配置带有自定义 SSL 证书的 Capsule 服务器在没有 Puppet 的情况下进行负载平衡
下面的部分论述了如何配置使用自定义 SSL 证书进行负载平衡的胶囊服务器,而无需 Puppet。
4.3.1. 为胶囊服务器创建自定义 SSL 证书 复制链接链接已复制到粘贴板!
此流程概述了如何为证书签名请求创建配置文件,并将负载均衡器和 Capsule 服务器作为 Subject Alternative Names (SAN)包含。在您要为负载均衡配置的每个 Capsule 服务器上完成这个步骤。
流程
要存储所有源证书文件,请创建一个只能被
root用户访问的目录:# mkdir /root/capsule_cert创建用于签署证书签名请求(CSR)的私钥。
请注意,私钥必须未加密。如果您使用密码保护的私钥,请删除私钥密码。
如果您已有此胶囊服务器的私钥,请跳过这一步。
# openssl genrsa -out /root/capsule_cert/capsule_cert_key.pem 4096为 CSR 创建
/root/capsule_cert/openssl.cnf配置文件并包含以下内容:[ req ] req_extensions = v3_req distinguished_name = req_distinguished_name x509_extensions = usr_cert prompt = no [ req_distinguished_name ] commonName = capsule.example.com1 [ v3_req ] basicConstraints = CA:FALSE keyUsage = digitalSignature, keyEncipherment extendedKeyUsage = serverAuth, clientAuth subjectAltName = @alt_names [alt_names]2 DNS.1 = loadbalancer.example.com DNS.2 = capsule.example.com有关
[ v3_req ]参数及其目的的更多信息,请参阅 RFC 5280: Internet X.509 公钥基础架构证书和证书撤销列表(CRL)配置文件。可选:如果要在 CSR 中添加可辨识名称(DN)详情,请在
[ req_distinguished_name ]部分中添加以下信息:[req_distinguished_name] CN = capsule.example.com countryName =My_Country_Name1 stateOrProvinceName = My_State_Or_Province_Name2 localityName = My_Locality_Name3 organizationName = My_Organization_Or_Company_Name organizationalUnitName = My_Organizational_Unit_Name4 生成 CSR:
# 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 将证书签名请求发送到证书颁发机构(CA)。同一 CA 必须为 Satellite 服务器和胶囊服务器签名证书。
提交请求时,指定证书的寿命。发送证书请求的方法会有所不同,因此请查阅 CA 了解首选方法。根据请求,您可以预期在单独的文件中接收 CA 捆绑包和签名证书。
- 将您从证书颁发机构接收的证书颁发机构和胶囊服务器证书文件复制到您的 Satellite 服务器。
- 在 Satellite 服务器上,验证 Capsule 服务器证书输入文件:
# katello-certs-check \
-c /root/{cert-name}_cert/{cert-name}_cert.pem \
-k /root/{cert-name}_cert/{cert-name}_cert_key.pem \
-b /root/{cert-name}_cert/ca_cert_bundle.pem
4.3.2. 配置带有自定义 SSL 证书的 Capsule 服务器在没有 Puppet 的情况下进行负载平衡 复制链接链接已复制到粘贴板!
下面的部分论述了如何配置使用自定义 SSL 证书进行负载平衡的胶囊服务器,而无需 Puppet。在您要为负载均衡配置的每个 Capsule 服务器上完成这个步骤。
流程
将以下选项附加到从
katello命令中:-certs-check命令的输出中获取的 Capsule-certs-generate--foreman-proxy-cname loadbalancer.example.com在 Satellite 服务器上,输入 Capsule
-certs-generate命令来生成 Capsule 证书:# capsule-certs-generate \ --certs-tar /root/capsule_cert/capsule.tar \ --foreman-proxy-cname loadbalancer.example.com \ --foreman-proxy-fqdn capsule.example.com \ --server-ca-cert /root/capsule_cert/ca_cert_bundle.pem \ --server-cert /root/capsule_cert/capsule.pem \ --server-key /root/capsule_cert/capsule.pem从输出保留示例
satellite-installer命令的副本,用于安装 Capsule 服务器证书。将证书存档文件从 Satellite 服务器复制到 Capsule 服务器:
# scp /root/capsule.example.com-certs.tar root@capsule.example.com:capsule.example.com-certs.tar将以下选项附加到您从 Capsule-
certs-generate 命令的输出中获取的命令中:satellite-installer--certs-cname "loadbalancer.example.com" \ --enable-foreman-proxy-plugin-remote-execution-script在 Capsule 服务器上,输入
satellite-installer命令:# satellite-installer --scenario capsule \ --certs-cname "loadbalancer.example.com" \ --certs-tar-file "capsule.example.com-certs.tar" \ --enable-foreman-proxy-plugin-remote-execution-script \ --foreman-proxy-foreman-base-url "https://satellite.example.com" \ --foreman-proxy-oauth-consumer-key "oauth key" \ --foreman-proxy-oauth-consumer-secret "oauth secret" \ --foreman-proxy-register-in-foreman "true" \ --foreman-proxy-trusted-hosts "satellite.example.com" \ --foreman-proxy-trusted-hosts "capsule.example.com"