|
| 1 | +// Module included in the following assemblies: |
| 2 | +// |
| 3 | +// * security/cert_manager_operator/cert-manager-operator-integrating-istio.adoc |
| 4 | + |
| 5 | +:_mod-docs-content-type: PROCEDURE |
| 6 | +[id="cert-manager-istio-csr-installing_{context}"] |
| 7 | += Creating the `IstioCSR` custom resource |
| 8 | + |
| 9 | +Use this procedure to install the Istio-CSR agent through {cert-manager-operator}. |
| 10 | + |
| 11 | +.Prerequisites |
| 12 | + |
| 13 | +* You have access to the cluster with `cluster-admin` privileges. |
| 14 | +* You have enabled the Istio-CSR feature. |
| 15 | +* You have created the `Issuer` or `ClusterIssuer` resources required for generating certificates for the Istio-CSR agent. |
| 16 | ++ |
| 17 | +[NOTE] |
| 18 | +==== |
| 19 | +If you are using `Issuer` resource, create the `Issuer` and `Certificate` resources in the {SMProductName} or `Istiod` namespace. Certificate requests are generated in the same namespace, and role-based access control (RBAC) is configured accordingly. |
| 20 | +==== |
| 21 | +
|
| 22 | +.Procedure |
| 23 | + |
| 24 | +. Create a new project for installing Istio-CSR by running the following command. You can use an existing project and skip this step. |
| 25 | ++ |
| 26 | +[source,terminal] |
| 27 | +---- |
| 28 | +$ oc new-project <istio_csr_project_name> |
| 29 | +---- |
| 30 | + |
| 31 | +. Create the `IstioCSR` custom resource to enable Istio-CSR agent managed by the {cert-manager-operator} for processing Istio workload and control plane certificate signing requests. |
| 32 | ++ |
| 33 | +[NOTE] |
| 34 | +==== |
| 35 | +Only one `IstioCSR` custom resource (CR) is supported at a time. If multiple `IstioCSR` CRs are created, only one will be active. Use the `status` sub-resource of `IstioCSR` to check if a resource is unprocessed. |
| 36 | + |
| 37 | +* If multiple `IstioCSR` CRs are created simultaneously, none will be processed. |
| 38 | +* If multiple `IstioCSR` CRs are created sequentially, only the first one will be processed. |
| 39 | +* To prevent new requests from being rejected, delete any unprocessed `IstioCSR` CRs. |
| 40 | +* The Operator does not automatically remove objects created for `IstioCSR`. If an active `IstioCSR` resource is deleted and a new one is created in a different namespace without removing the previous deployments, multiple `istio-csr` deployments may remain active. This behavior is not recommended and is not supported. |
| 41 | +==== |
| 42 | +
|
| 43 | +.. Create a YAML file, for example, `istiocsr.yaml`, that defines the `IstioCSR` object: |
| 44 | ++ |
| 45 | +.Example `IstioCSR.yaml` file |
| 46 | +[source,yaml] |
| 47 | +---- |
| 48 | +apiVersion: operator.openshift.io/v1alpha1 |
| 49 | +kind: IstioCSR |
| 50 | +metadata: |
| 51 | + name: default |
| 52 | + namespace: <istio_csr_project_name> |
| 53 | +spec: |
| 54 | + IstioCSRConfig: |
| 55 | + certManager: |
| 56 | + issuerRef: |
| 57 | + name: istio-ca <1> |
| 58 | + kind: Issuer <2> |
| 59 | + group: cert-manager.io |
| 60 | + istiodTLSConfig: |
| 61 | + trustDomain: cluster.local |
| 62 | + istio: |
| 63 | + namespace: istio-system |
| 64 | +---- |
| 65 | +<1> Specify the `Issuer` or `ClusterIssuer` name. It should be the same name as the CA issuer defined in the `issuer.yaml` file. |
| 66 | +<2> Specify the `Issuer` or `ClusterIssuer` kind. It should be the same kind as the CA issuer defined in the `issuer.yaml` file. |
| 67 | + |
| 68 | +.. Create the `IstioCSR` custom resource by running the following command: |
| 69 | ++ |
| 70 | +[source,terminal] |
| 71 | +---- |
| 72 | +$ oc create -f IstioCSR.yaml |
| 73 | +---- |
| 74 | + |
| 75 | +.Verification |
| 76 | + |
| 77 | +. Verify that the Istio-CSR deployment is ready by running the following command: |
| 78 | ++ |
| 79 | +[source,terminal] |
| 80 | +---- |
| 81 | +$ oc get deployment -n <istio_csr_project_name> |
| 82 | +---- |
| 83 | ++ |
| 84 | +.Example output |
| 85 | +[source,terminal] |
| 86 | +---- |
| 87 | +NAME READY UP-TO-DATE AVAILABLE AGE |
| 88 | +cert-manager-istio-csr 1/1 1 1 24s |
| 89 | +---- |
| 90 | + |
| 91 | +. Verify that the Istio-CSR pods are running by running the following command: |
| 92 | ++ |
| 93 | +[source,terminal] |
| 94 | +---- |
| 95 | +$ oc get pod -n <istio_csr_project_name> |
| 96 | +---- |
| 97 | ++ |
| 98 | +.Example output |
| 99 | +[source,terminal] |
| 100 | +---- |
| 101 | +NAME READY STATUS RESTARTS AGE |
| 102 | +cert-manager-istio-csr-5c979f9b7c-bv57w 1/1 Running 0 45s |
| 103 | +---- |
| 104 | + |
| 105 | +** Verify that the Istio-CSR pod is not reporting any errors in the logs by running the following command: |
| 106 | ++ |
| 107 | +[source,terminal] |
| 108 | +---- |
| 109 | +$ oc -n <istio_csr_project_name> logs <istio_csr_pod_name> |
| 110 | +---- |
| 111 | + |
| 112 | +** Verify that the {cert-manager-operator} pod is not reporting any errors by running the following command: |
| 113 | ++ |
| 114 | +[source,terminal] |
| 115 | +---- |
| 116 | +$ oc -n cert-manager-operator logs <cert_manager_operator_pod_name> |
| 117 | +---- |
0 commit comments