This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.Ce contenu n'est pas disponible dans la langue sélectionnée.
Chapter 10. Configuring Custom Certificates
10.1. Overview Copier lienLien copié sur presse-papiers!
Administrators can configure custom serving certificates for the public host names of the OpenShift Container Platform API and web console. This can be done during an advanced installation or configured after installation.
10.2. Configuring Custom Certificates with Ansible Copier lienLien copié sur presse-papiers!
During advanced installations, custom certificates can be configured using the openshift_master_named_certificates
and openshift_master_overwrite_named_certificates
parameters, which are configurable in the inventory file. More details are available about configuring custom certificates with Ansible.
Example Custom Certificate Configuration with Ansible
10.3. Configuring Custom Certificates Copier lienLien copié sur presse-papiers!
In the master configuration file you can list the namedCertificates
section in the assetConfig.servingInfo
section so the custom certificate serves up for the web console, and in the servingInfo
section so the custom certificate serves up for the CLI and other API calls. Multiple certificates can be configured this way and each certificate may be associated with multiple host names or wildcards.
A default certificate must be configured in the servingInfo.certFile
and servingInfo.keyFile
configuration sections in addition to namedCertificates
.
The namedCertificates
section should only be configured for the host name associated with the masterPublicURL
, assetConfig.publicURL
, and oauthConfig.assetPublicURL
settings. Using a custom serving certificate for the host name associated with the masterURL
will result in TLS errors as infrastructure components will attempt to contact the master API using the internal masterURL
host.
Custom Certificates Configuration
Relative paths are resolved relative to the master configuration file. Restart the server to pick up the configuration changes.
For the master API or web console, wildcard names are accepted.
10.4. Configuring a Custom Wildcard Certificate for the Default Router Copier lienLien copié sur presse-papiers!
You can configure the OpenShift Container Platform default router with a default wildcard certificate. A default wildcard certificate provides a convenient way for applications that are deployed in OpenShift Container Platform to use default encryption without needing custom certificates.
Default wildcard certificates are recommended for non-production environments only.
To configure a default wildcard certificate, provision a certificate that is valid for *.<app_domain>
, where <app_domain>
is the value of openshift_master_default_subdomain
in the Ansible inventory file, by default /etc/ansible/hosts
. Once provisioned, place the certificate, key, and ca certificate files on your Ansible host, and add the following line to your Ansible inventory file.
openshift_hosted_router_certificate={"certfile": "/path/to/apps.c1-ocp.myorg.com.crt", "keyfile": "/path/to/apps.c1-ocp.myorg.com.key", "cafile": "/path/to/apps.c1-ocp.myorg.com.ca.crt"}
openshift_hosted_router_certificate={"certfile": "/path/to/apps.c1-ocp.myorg.com.crt", "keyfile": "/path/to/apps.c1-ocp.myorg.com.key", "cafile": "/path/to/apps.c1-ocp.myorg.com.ca.crt"}
For example:
openshift_hosted_router_certificate={"certfile": "/home/cloud-user/star-apps.148.251.233.173.nip.io.cert.pem", "keyfile": "/home/cloud-user/star-apps.148.251.233.173.nip.io.key.pem", "cafile": "/home/cloud-user/ca-chain.cert.pem"}
openshift_hosted_router_certificate={"certfile": "/home/cloud-user/star-apps.148.251.233.173.nip.io.cert.pem", "keyfile": "/home/cloud-user/star-apps.148.251.233.173.nip.io.key.pem", "cafile": "/home/cloud-user/ca-chain.cert.pem"}
Where the parameter values are:
- certfile is the path to the file that contains the OpenShift Container Platform router certificate.
- keyfile is the path to the file that contains the OpenShift Container Platform wildcard key.
- cafile is the path to the file that contains the root CA for this key and certificate. If an intermediate CA is in use, the file should contain both the intermediate and root CA.
If these certificate files are new to your OpenShift Container Platform cluster, run the Ansible byo/config.yml playbook to add these files to the OpenShift Container Platform configuration files. The playbook adds the certificate files to the /etc/origin/master/ directory.
ansible-playbook [-i /path/to/inventory] \ /usr/share/ansible/openshift-ansible/playbooks/byo/config.yml
# ansible-playbook [-i /path/to/inventory] \
/usr/share/ansible/openshift-ansible/playbooks/byo/config.yml
If the certificates are not new, for example, you want to change existing certificates or replace expired certificates, run the following playbook:
ansible-playbook /usr/share/ansible/openshift-ansible/playbooks/redeploy-certificates.yml
ansible-playbook /usr/share/ansible/openshift-ansible/playbooks/redeploy-certificates.yml
For this playbook to run, the certificate names must not change. If the certificate names change, rerun the Ansible byo/config.yml playbook as if the certificates were new.
10.5. Configuring a Custom Certificate for a Load Balancer Copier lienLien copié sur presse-papiers!
If your OpenShift Container Platform cluster uses the default load balancer or an enterprise-level load balancer, you can use custom certificates to make the web console and API available externally using a publicly-signed custom certificate. leaving the existing internal certificates for the internal endpoints.
To configure OpenShift Container Platform to use custom certificates in this way:
Edit the
servingInfo
section of the master configuration file:Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteConfigure the
namedCertificates
section for only the host name associated with themasterPublicURL
andoauthConfig.assetPublicURL
settings. Using a custom serving certificate for the host name associated with themasterURL
causes in TLS errors as infrastructure components attempt to contact the master API using the internal masterURL host.Specify the
openshift_master_cluster_public_hostname
andopenshift_master_cluster_hostname
paramaters in the Ansible inventory file, by default /etc/ansible/hosts. These values must be different. If they are the same, the named certificates will fail.Native HA with External LB VIPs
# Native HA with External LB VIPs openshift_master_cluster_hostname=paas.example.com
1 openshift_master_cluster_public_hostname=public.paas.example.com
2 Copy to Clipboard Copied! Toggle word wrap Toggle overflow
For information specific to your load balancer environment, refer to the OpenShift Container Platform Reference Architecture for your provider and Custom Certificate SSL Termination (Production).