Configure the CDM TLS certificate
CDM Node terminates the TLS connections that Core Clusters open on the leafnode port 6237. It uses the certificate from the cdm-tls-cert Secret in the cennso-system namespace. Cennso does not create this Secret. You create a cert-manager Certificate resource that issues it.
This guide explains how to issue the certificate and how to change it later. If CDM is reachable under more than one domain, for example a private and a public one, the certificate must cover each of them.
Prerequisites
- The cert-manager extension is installed on the Management Cluster.
- A cert-manager
ClusterIssuerthat uses a publicly trusted certificate authority. Core Cluster agents trust the default certificate authorities and have no setting for a custom one. - A DNS-01 solver on the
ClusterIssuerwhen the certificate contains wildcard names. Certificate authorities issue wildcard certificates only after a DNS-01 challenge. - The CDM domain from Configure Cennso Data Mesh. If you use a public CDM domain, you need it as well.
Domain name rules
Core Clusters connect to CDM Node with the domain from the CDM_NODE_ENDPOINT value, for example tls://cdm-node.test.example.net:6237. The certificate must contain a name that matches this domain. Follow these rules when you list the names:
- A wildcard name matches exactly one DNS label. The name
*.test.example.netmatchescdm-node.test.example.netbut notcdm-node.public.test.example.net. Add a second wildcard*.public.test.example.netfor the public domain. - Cover every domain that Core Clusters use to reach CDM Node.
- Cover every host that an Application Load Balancer (ALB) serves with
cennso-system/cdm-tls-certas its default certificate. For an example, see Set up a private connection between clusters in IBM Cloud.
Steps
Create a file named
cdm-tls-cert.yamlwith the followingCertificateresource. Replace{CLUSTER_ISSUER_NAME}with the name of yourClusterIssuerand adjust the domain names:yaml(Optional) If the
cdm-tls-certSecret already exists, save a copy of it:Caution
When cert-manager issues the certificate, it replaces the content of an existing
cdm-tls-certSecret. The backup file contains the private key. Store it in a secure place.bashApply the resource:
bashWait until cert-manager issues the certificate:
bashThe command prints the following line when the issue succeeds:
text
CDM Node serves the new certificate after its pods restart. With CDM Node 1.7.0 or later, the restart starts by itself. For earlier versions, see Apply a renewed certificate.
Verification
To check that CDM Node serves a certificate that matches your domain, run the following command with your CDM domain:
Sample output:
To list the names in the certificate that CDM Node serves, run:
Sample output:
Note
If the verification fails, see Certificate is not ready, TLS handshake fails, or CDM Node serves an old certificate.
Add a domain name later
To add a domain name, for example when you expose CDM on a public domain, edit the Certificate resource:
Add the name to
spec.dnsNamesincdm-tls-cert.yaml. For a public domaincdm-node.public.test.example.net, add'*.public.test.example.net'.Apply the resource:
bash
cert-manager issues a new certificate for the changed list. Public certificate authorities limit how often they issue certificates for the same names. Add all names in one change.
Apply a renewed certificate
CDM Node reads the certificate when it starts and keeps it in memory. A renewed or re-issued certificate reaches CDM Node only after its pods restart.
CDM Node 1.7.0 and later restart automatically. The Reloader component watches the cdm-tls-cert Secret and restarts the cdm-node pods one at a time. The restart takes about one minute.
For earlier CDM Node versions, restart the pods yourself after each issue:
To wait for the restart to finish, run:
The command prints partitioned roll out complete: 3 new pods have been updated... when all pods run again.