$ 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.
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 TLS secret with your wildcard certificate and updating the Ingress Controller and cluster proxy configuration.
|
Before using the procedure, ensure you understand the following Ingress Controller behaviors:
|
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 CA certificate.
Copy the root CA certificate into an additional PEM format file.
Verify that all certificates which include -----END CERTIFICATE----- also end with one carriage return after that line.
Create a config map that includes only the root CA certificate that is used to sign 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>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 newly created 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 |
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 newly created secret:
$ oc patch ingresscontroller.operator default \
--type=merge -p \
'{"spec":{"defaultCertificate": {"name": "<secret>"}}}' \
-n openshift-ingress-operator
<secret>:: Specifies the name used for the secret. Replace <secret> with the name used for the secret.