Create a secret for the ingress controller certificateSecret

To serve a custom default certificate through the ingress controller in MicroShift, you can create a TLS secret containing your certificate chain and private key, then set the certificateSecret value in the configuration file to that secret name.

Note

Any in-use certificates is automatically integrated with the MicroShift built-in OAuth server.

Prerequisites
  • You have root access to MicroShift.

  • You installed the OpenShift CLI (oc).

  • Your private key is not encrypted or you have decrypted it for importing into MicroShift.

Procedure
  1. 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
    • Replace <secret> with the name of the secret that contains the certificate chain and private key.

    • Replace </path/to/cert.crt> with the path to the certificate chain on your local file system.

    • Replace </path/to/cert.key> with the path to the private key associated with this certificate.

      Important

      The certificate must include the subjectAltName extension showing *.apps.<nodename>.<domain>.

  2. Update the certificateSecret parameter value in the MicroShift configuration YAML with the newly created secret.

  3. Complete any other configurations you require, then start or restart MicroShift by running one the following commands:

    $ sudo systemctl start microshift
    $ sudo systemctl restart microshift