TLS certificates#
To ensure that all communications between clients and MKE 4k are encrypted, MKE 4k services are exposed using HTTPS. By default, this is done using self-signed TLS certificates that are not trusted by client tools such as web browsers. Thus, when you try to access MKE 4k, your browser warns that it does not trust MKE 4k or that MKE 4k has an invalid certificate.
You can configure MKE 4k to use your own TLS certificates so that your browser
and other client tools will trust your MKE 4k installation. The address you
configure for these custom TLS certificates must differ from the address that is
specified in .spec.apiServer.externalAddress, and you must use a separate DNS name
for the endpoint where the custom TLS certificates are applied.
Info
Mirantis recommends that you make TLS certificate changes outside of peak business hours. Your applications will continue to run normally. The Kube API Server and Ingress Controller will both restart, though, and as such your workloads may experience a short period of unavailability.
Use the MKE 4k CLI (mkectl) to configure MKE 4k to use your own TLS certificates and keys:
-
All keys and certificates must be uploaded in PEM format.
-
Enable your custom TLS certificates.
In the
spec.certificatessection of themke4.yamlconfiguration file:-
Set
enabledtotrue. -
Add your TLS certificates in the PEM format under
ca,certandkey.
-
-
Set a fully qualified domain name in the
.spec.certificates.domainNamesection of themke4.yamlconfiguration file.Important
- The domain name can be an IP address, but only if that IP is visible to the Kube API server.
- Make sure the domain name is not the same as the
address specified in
.spec.apiServer.externalAddress.
A fully configured
spec.certificatessection is illustrated below:spec: certificates: enabled: true domainName: "not.external-address.com" ca: | -----BEGIN CERTIFICATE----- <pem-data> -----END CERTIFICATE----- cert: | -----BEGIN CERTIFICATE----- <pem-data> -----END CERTIFICATE----- key: | -----BEGIN PRIVATE KEY----- <pem-data> -----END PRIVATE KEY----- -
Apply the configuration:
mkectl apply -
Once the
mkectl applycommand completes, to avoid storing sensitive data in the local file you can remove thecertandkeyfields from.spec.certificates, as at this point the certificates have been stored securely in the cluster.Warning
Do not remove the
cakey and its value from.spec.certificates.