Creating certificates for user workloads
To secure communications for your applications, create and manage TLS certificates for your workloads by using the cert-manager Operator for Red Hat OpenShift
-
You have access to the cluster with
cluster-adminprivileges. -
You have installed the cert-manager Operator for Red Hat OpenShift.
-
Create an issuer. For more information, see "Configuring an issuer" in the "Additional resources" section.
-
Create a certificate:
-
Create a YAML file, for example,
certificate.yaml, that defines theCertificateobject:apiVersion: cert-manager.io/v1 kind: Certificate metadata: name: <tls_cert> namespace: <issuer_namespace> spec: isCA: false commonName: '<common_name>' secretName: <secret_name> dnsNames: - "<domain_name>" issuerRef: name: <issuer_name> kind: Issuerwhere:
<tls_cert>-
Specifies a name for the certificate.
<issuer_namespace>-
Specifies the namespace of the issuer.
<common_name>-
Specifies the common name (CN).
<secret_name>-
Specifies the name of the secret to create that contains the certificate.
<domain_name>-
Specifies the domain name.
<issuer_name>-
Specifies the name of the issuer.
-
Create the
Certificateobject by running the following command:$ oc create -f certificate.yaml
-
-
Verify that the certificate is created and ready to use by running the following command:
$ oc get certificate -w -n <issuer_namespace>Once certificate is in
Readystatus, workloads on your cluster can start using the generated certificate secret.