|  | 
|  | 1 | +// Module included in the following assemblies: | 
|  | 2 | +// | 
|  | 3 | +// * security/zero_trust_workload_identity_manager/zero-trust-manager-upstream-authority plugins.adoc | 
|  | 4 | + | 
|  | 5 | +:_mod-docs-content-type: PROCEDURE | 
|  | 6 | +[id="zero-trust-manager-cert-manager-crd_{context}"] | 
|  | 7 | += Configuring cert-manager plugin using the SPIRE server CRD | 
|  | 8 | + | 
|  | 9 | +To configure the cert-manager plugin using the SPIRE server Custom Resource Defnition (CRD), performe the following steps: | 
|  | 10 | + | 
|  | 11 | +.Procedure | 
|  | 12 | + | 
|  | 13 | +. Create a YAML file containing the configuration for the `SpireServer` resource, for example `spireserver.yaml`: | 
|  | 14 | ++ | 
|  | 15 | +.Example `spireserver.yaml` | 
|  | 16 | ++ | 
|  | 17 | +[source,yaml] | 
|  | 18 | +---- | 
|  | 19 | +apiVersion: operator.openshift.io/v1alpha1 | 
|  | 20 | +kind: SpireServer | 
|  | 21 | +metadata: | 
|  | 22 | +  name: cluster | 
|  | 23 | +spec: | 
|  | 24 | +  trustDomain: "example.org" | 
|  | 25 | +  upstreamAuthority: | 
|  | 26 | +    type: "cert-manager" | 
|  | 27 | +    upstreamAuthorityCertManager: | 
|  | 28 | +      issuerName: "ca-issuer" <1> | 
|  | 29 | +      issuerKind: "ClusterIssuer" <2> | 
|  | 30 | +      issuerGroup: "cert-manager.io" <3> | 
|  | 31 | +      namespace: "zero-trust-workload-identity-manager" <4> | 
|  | 32 | +      kubeConfigSecretName: "external-cluster-kubeconfig" <5> | 
|  | 33 | +---- | 
|  | 34 | +<1> The name of the `cert-manager` Issuer or ClusterIssuer that signs the `certificateRequest`. | 
|  | 35 | +<2> Set to `ClusterIssuer` if issuer is cluster-scoped. The default is `Issuer`. | 
|  | 36 | +<3> The API group of the issuer. The default is `cert-manager.io`. | 
|  | 37 | +<4> The namespace where the `CertificateRequest` is created. The default is `zero-trust-workload-identity-manager`. | 
|  | 38 | +<5> The name of a Secret containing the `kubeconfig` to connect to the clsuter where `cert-manager` is running. If empy, an in-cluster configuration is used. | 
|  | 39 | + | 
|  | 40 | +. Apply the configuration by running the following command: | 
|  | 41 | ++ | 
|  | 42 | +[source, terminal] | 
|  | 43 | +---- | 
|  | 44 | +$ oc apply -f spireserver.yaml | 
|  | 45 | +---- | 
|  | 46 | + | 
|  | 47 | +.Verification | 
|  | 48 | + | 
|  | 49 | +. Run the following command to list the `CertificateRequest` resources in the namespace where the SPIRE server creates them. | 
|  | 50 | ++ | 
|  | 51 | +[source, terminal] | 
|  | 52 | +---- | 
|  | 53 | +$ oc get certificaterequests -n <namespace> | 
|  | 54 | +---- | 
|  | 55 | + | 
|  | 56 | +. Run the following command ot inspect a specific `CertificateRequest`. Review the `Status` section to confirm the certificate has been signed and that  the certificate data is present. | 
|  | 57 | ++ | 
|  | 58 | +[source, terminal] | 
|  | 59 | +---- | 
|  | 60 | +$ oc describe certificaterequest <name-of-cert-request> -n <namespace> | 
|  | 61 | +---- | 
0 commit comments