$ oc create configmap custom-ca \
--from-file=ca-bundle.crt=</path/to/example-ca.crt> \
-n openshift-config
To allow external clients to connect securely to applications under the .apps subdomain in OKD, you can replace the default wildcard ingress certificate with one issued by a trusted public CA.
You can replace the default ingress certificate with a certificate from a public CA so that external clients connect securely to your applications.
The default ingress certificate in OKD is a wildcard certificate that the Ingress Operator issues from an internal CA for the web console, CLI, and applications under the .apps subdomain.
After you replace the default ingress certificate, you need to renew or rotate it before it expires.
The Ingress Controller reads the certificate and key from a secret you created. When you renew the certificate, external certificate management tools or the cert-manager Operator replace the certificate and key contents inside that secret without changing the secret name.
Each node runs an agent called kubelet, which monitors secrets that pods on that node use. When the kubelet detects that the contents of the certificate secret changed, it updates the certificate files on the node. The Ingress Controller router pods on that node read these certificate files, detect the changes, and load the new certificate and key without restarting.
Because the router pods load the new certificate without restarting, OKD doesn’t roll out a new router deployment. This automatic reload happens whether you manage certificates manually or use the cert-manager Operator to rotate them automatically.
To secure the web console, CLI, and all applications under the .apps subdomain in OKD, you can replace the default ingress certificate by creating a Transport Layer Security (TLS) secret with your wildcard certificate and updating the Ingress Controller and cluster proxy configuration.
|
Replacing the default ingress certificate does not change the web console route certificate. To support HTTP/2, the Console Operator creates a self-signed certificate for the console route, so browsers still show certificate warnings. To use a trusted certificate, set the console route certificate in the |
You must have a wildcard certificate for the fully qualified .apps subdomain and its corresponding private key. Each should be in a separate PEM format file.
The private key must be unencrypted. If your key is encrypted, decrypt it before importing it into OKD.
The certificate must include the subjectAltName extension showing *.apps.<clustername>.<domain>.
The certificate file can contain one or more certificates in a chain. The file must list the wildcard certificate as the first certificate, followed by other intermediate certificates, and then ending with the root certificate authority (CA) certificate.
Copy the root CA certificate into an additional PEM format file.
Create a config map that includes only the root CA certificate that signs the wildcard certificate:
$ oc create configmap custom-ca \
--from-file=ca-bundle.crt=</path/to/example-ca.crt> \
-n openshift-config
where:
</path/to/example-ca.crt>specifies the path to the root CA certificate file on your local file system. For example, /etc/pki/ca-trust/source/anchors.
Update the cluster-wide proxy configuration with the new config map:
$ oc patch proxy/cluster \
--type=merge \
--patch='{"spec":{"trustedCA":{"name":"custom-ca"}}}'
|
If you update only the trusted CA for your cluster, the MCO updates the If you change any other parameter in the |
Verify that all certificates that include -----END CERTIFICATE----- also end with one carriage return after that line.
Create a secret that contains the wildcard certificate chain and key:
$ oc create secret tls <secret> \
--cert=</path/to/cert.crt> \
--key=</path/to/cert.key> \
-n openshift-ingress
where:
<secret>specifies the name of the secret that will contain the certificate chain and private key.
</path/to/cert.crt>specifies the path to the certificate chain on your local file system.
</path/to/cert.key>specifies the path to the private key associated with this certificate.
Update the Ingress Controller configuration with the new secret:
$ oc patch ingresscontroller.operator default \
--type=merge -p \
'{"spec":{"defaultCertificate": {"name": "<secret>"}}}' \
-n openshift-ingress-operator
where:
<secret>specifies the name of the secret. Replace <secret> with the name you used for the secret.