// Module included in the following assemblies:
//
// * security/cert_manager_operator/cert-manager-creating-certificate.adoc

:_mod-docs-content-type: PROCEDURE
[id="cert-manager-certificate-mgmt_{context}"]
= Creating certificates for user workloads

[role="_abstract"]
To secure communications for your applications, create and manage TLS certificates for your workloads by using the {cert-manager-operator}

.Prerequisites

* You have access to the cluster with `cluster-admin` privileges.
* You have installed the {cert-manager-operator}.

.Procedure

. 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 the `Certificate` object:
+
[source, yaml]
----
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: Issuer
----
+
where:
+
`<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 `Certificate` object by running the following command:
+
[source, terminal]
----
$ oc create -f certificate.yaml
----

.Verification

* Verify that the certificate is created and ready to use by running the following command:
+
[source, terminal]
----
$ oc get certificate -w -n <issuer_namespace>
----
+
Once certificate is in `Ready` status, workloads on your cluster can start using the generated certificate secret.
