Este contenido no está disponible en el idioma seleccionado.
Chapter 4. OpenShift Service Mesh and cert-manager
The cert-manager tool provides a unified API to manage X.509 certificates for applications in a Kubernetes environment. You can use cert-manager to integrate with public or private key infrastructures (PKI) and automate certificate renewal.
The cert-manager tool ensures the certificates are valid and up-to-date by attempting to renew certificates at a configured time before they expire.
4.1. About integrating Service Mesh with cert-manager and istio-csr Copiar enlaceEnlace copiado en el portapapeles!
The cert-manager tool provides integration with Istio through an external agent called istio-csr. The istio-csr agent handles certificate signing requests (CSR) from Istio proxies and the controlplane in the following ways:
- Verifying the identity of the workload.
- Creating a CSR through cert-manager for the workload.
The cert-manager tool then creates a CSR to the configured CA Issuer, which signs the certificate.
Red Hat provides support for integrating with istio-csr and cert-manager. Red Hat does not provide direct support for the istio-csr or the community cert-manager components. The use of community cert-manager shown here is for demonstration purposes only.
Prerequisites
One of these versions of cert-manager:
- Red Hat cert-manager Operator 1.10 or later
- community cert-manager Operator 1.11 or later
- cert-manager 1.11 or later
- Red Hat OpenShift Service Mesh 3.0 or later
-
An
IstioCNIinstance is running in the cluster -
Istio CLI (
istioctl) tool is installed -
jqis installed - Helm is installed
4.1.1. Installing cert-manager Copiar enlaceEnlace copiado en el portapapeles!
You can integrate cert-manager with OpenShift Service Mesh by deploying istio-csr and then creating an Istio resource that uses the istio-csr agent to process workload and control plane certificate signing requests. This example creates a self-signed Issuer, but any other Issuer can be used instead.
You must install cert-manager before installing your Istio resource.
Procedure
Create the
istio-systemnamespace by running the following command:oc create namespace istio-system
$ oc create namespace istio-systemCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create the root issuer by creating an
Issuerobject in a YAML file.Create an
Issuerobject similar to the following example:Example
issuer.yamlfileCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create the objects by running the following command:
oc apply -f issuer.yaml
$ oc apply -f issuer.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow Wait for the
istio-cacertificate to contain the "Ready" status condition by running the following command:oc wait --for=condition=Ready certificates/istio-ca -n istio-system
$ oc wait --for=condition=Ready certificates/istio-ca -n istio-systemCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Copy the
istio-cacertificate to thecert-managernamespace so it can be used by istio-csr:Copy the secret to a local file by running the following command:
oc get -n istio-system secret istio-ca -o jsonpath='{.data.tls\.crt}' | base64 -d > ca.pem$ oc get -n istio-system secret istio-ca -o jsonpath='{.data.tls\.crt}' | base64 -d > ca.pemCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create a secret from the local certificate file in the
cert-managernamespace by running the following command:oc create secret generic -n cert-manager istio-root-ca --from-file=ca.pem=ca.pem
$ oc create secret generic -n cert-manager istio-root-ca --from-file=ca.pem=ca.pemCopy to Clipboard Copied! Toggle word wrap Toggle overflow