Chapter 3. Custom issuers for cert-manager
An issuer is a resource that acts as a certificate authority for a specific namespace, and is managed by the cert-manager Operator. TLS-e (TLS everywhere) is enabled in Red Hat OpenStack Services on OpenShift (RHOSO) environments, and it uses the following issuers by default:
- rootca-internal
- rootca-libvirt
- rootca-ovn
- rootca-public
3.1. Creating a custom issuer Copy linkLink copied to clipboard!
You can create custom ingress as well as custom internal issuers. To create and manage your own certificates for internal endpoints, you must create a custom internal issuer.
Procedure
Create a custom issuer in a file named
rootca-custom.yaml:apiVersion: cert-manager.io/v1 kind: Issuer metadata: name: <issuer_name> spec: ca: secretName: <secret_name>where:
<issuer_name>-
Specifies the name of your custom issuer, for example,
rootca-ingress-custom. <secret_name>- Specifies the name of the Secret CR used by the certificate for your custom issuer. If you do not include a secret, one is created automatically.
Create a certificate in a file named
ca-issuer-certificate.yaml:apiVersion: cert-manager.io/v1 kind: Certificate metadata: name: <issuer_name> spec: commonName: <issuer_name> isCA: true duration: <hours> privateKey: algorithm: RSA size: 3072 issuerRef: name: selfsigned-issuer kind: Issuer secretName: <secret-name>where:
<issuer_name>- Specifies the name of your custom issuer. This matches the issuer created in the first step.
<hours>-
Specifies the duration in hours, for example, a value of
87600his equivalent to 3650 days, or about 10 years. <secret_name>- Specifies the name of the Secret CR used by the certificate for your custom issuer. If you do not include a secret, one is created automatically.
Create the issuer and certificate:
$ oc create -f rootca-custom.yaml $ oc create -f ca-issuer-certificate.yamlAdd the custom issuer to the TLS service definition in the control plane CR file.
If your custom issuer is an ingress issuer, the customer issuer is defined under the
ingressattribute as shown below:apiVersion: core.openstack.org/v1beta1 kind: OpenStackControlPlane metadata: name: openstack-control-plane spec: tls: ingress: enabled: true ca: customIssuer: <issuer_name> ...where:
<issuer_name>- Specifies the name of your custom issuer. This matches the issuer created in the first step.
If your custom issuer is an internal issuer, the custom issuer is defined at the pod level under the
internalattribute as shown below:apiVersion: core.openstack.org/v1beta1 kind: OpenStackControlPlane metadata: name: myctlplane spec: tls: ingress: enabled: true podLevel: enabled: true internal: ca: customIssuer: <issuer_name>where:
<issuer_name>- Specifies the name of your custom issuer. This matches the issuer created in the first step.