|
| 1 | +<p align="center"><img src="https://github.com/jetstack/cert-manager/blob/master/logo/logo.png" width="250x" /></p> |
| 2 | +</a> |
| 3 | +<a href="https://godoc.org/github.com/cert-manager/istio-csr"><img src="https://godoc.org/github.com/cert-manager/istio-csr?status.svg"></a> |
| 4 | +<a href="https://goreportcard.com/report/github.com/cert-manager/istio-csr"><img alt="Go Report Card" src="https://goreportcard.com/badge/github.com/cert-manager/istio-csr" /></a></p> |
| 5 | + |
1 | 6 | # istio-csr |
2 | 7 |
|
3 | | -cert-manager-istio-csr is an agent which allows for [istio](https://istio.io) workload |
4 | | -and control plane components to be secured using |
| 8 | +istio-csr is an agent that allows for [Istio](https://istio.io) workload and |
| 9 | +control plane components to be secured using |
5 | 10 | [cert-manager](https://cert-manager.io). Certificates facilitating mTLS, inter |
6 | 11 | and intra cluster, will be signed, delivered and renewed using [cert-manager |
7 | 12 | issuers](https://cert-manager.io/docs/concepts/issuer). |
8 | 13 |
|
9 | | -⚠️ Currently supports istio versions v1.7+ |
| 14 | +⚠️ Currently supports Istio versions v1.7+ |
| 15 | + |
10 | 16 | ⚠️ Currently supports cert-manager versions v1.3+ |
11 | 17 |
|
12 | 18 | --- |
13 | 19 |
|
14 | 20 | ## Installation |
15 | 21 |
|
| 22 | +### Installing cert-manager |
| 23 | + |
16 | 24 | Firstly, [cert-manager must be |
17 | | -installed](https://cert-manager.io/docs/installation/) in your cluster. An |
18 | | -issuer must be configured, which will be used to sign your certificate |
19 | | -workloads, as well a ready Certificate to serve istiod. Example Issuer and |
20 | | -istiod Certificate configuration can be found in |
21 | | -[`./hack/demo/cert-manager-bootstrap-resources.yaml`](./hack/demo/cert-manager-bootstrap-resources.yaml). |
| 25 | +installed](https://cert-manager.io/docs/installation/) in your cluster. |
| 26 | + |
| 27 | +### Issuer or ClusterIssuer |
| 28 | +An Issuer or ClusterIssuer must be configured which will be used to sign Istio |
| 29 | +certificates against. |
| 30 | + |
| 31 | +Here are examples of CA [Issuer](./docs/example-issuer.yaml) and |
| 32 | +[ClusterIssuer](./docs/example-cluster-issuer.yaml) configurations that are |
| 33 | +bootstrapped through self-signed issuers. It is advised to not use the CA Issuer |
| 34 | +type in production environments, and instead use an issuer who's CA private key |
| 35 | +material does not reside within the cluster. |
| 36 | + |
| 37 | +> It is important to use an issuer type that is able to sign Istio mTLS workload |
| 38 | +> certificates (SPIFFE URI SANs) and |
| 39 | +> [istiod serving certificates](./deploy/charts/istio-csr/templates/certificate.yaml). |
| 40 | +> ACME issuers will not work. |
| 41 | +
|
| 42 | +If using an Issuer rather than the ClusterIssuer type, the Issuer must reside in |
| 43 | +the same namespace as that configured by `--certificate-namespace` on istio-csr, |
| 44 | +`istio-system` by default. |
| 45 | + |
| 46 | +### Installing istio-csr |
| 47 | + |
| 48 | +Next, install istio-csr into the cluster, configured to use the Issuer or |
| 49 | +ClusterIssuer installed earlier. |
| 50 | + |
| 51 | +> ⚠️ It is highly recommended that the root CA certificates are statically |
| 52 | +> defined in istio-csr. If they are not, istio-csr will "discover" the root CA |
| 53 | +> certificates when requesting its serving certificate, effectively making |
| 54 | +> istio-csr [TOFU](https://en.wikipedia.org/wiki/Trust_on_first_use). |
22 | 55 |
|
23 | | -Next, install the cert-manager-istio-csr into the cluster, configured to use |
24 | | -the Issuer deployed. The Issuer must reside in the same namespace as that |
25 | | -configured by `-c, --certificate-namespace`, which is `istio-system` by default. |
| 56 | +#### Discover root CAs installation |
26 | 57 |
|
27 | | -```bash |
| 58 | +```terminal |
28 | 59 | $ helm repo add jetstack https://charts.jetstack.io |
29 | 60 | $ helm repo update |
| 61 | +$ kubectl create namespace istio-system |
30 | 62 | $ helm install -n cert-manager cert-manager-istio-csr jetstack/cert-manager-istio-csr |
31 | 63 | ``` |
32 | 64 |
|
33 | | -All helm value options can be found in |
34 | | -[here](./deploy/charts/istio-csr/README.md). |
| 65 | +#### Load root CAs from file ca.pem (Preferred) |
35 | 66 |
|
36 | | -If you are running Openshift, prepare the cluster for Istio. |
37 | | -Follow instructions from Istio [platform setup guide](https://istio.io/latest/docs/setup/platform-setup/openshift/) |
| 67 | +```terminal |
| 68 | +$ helm repo add jetstack https://charts.jetstack.io |
| 69 | +$ helm repo update |
| 70 | +$ kubectl create namespace istio-system |
| 71 | +$ kubectl create secret generic istio-root-ca --from-file=ca.pem=ca.pem -n cert-manager |
| 72 | +$ helm install -n cert-manager cert-manager-istio-csr jetstack/cert-manager-istio-csr \ |
| 73 | + --set "app.tls.rootCAFile=/var/run/secrets/istio-csr/ca.pem" \ |
| 74 | + --set "volumeMounts[0].name=root-ca" \ |
| 75 | + --set "volumeMounts[0].mountPath=/var/run/secrets/istio-csr" \ |
| 76 | + --set "volumes[0].name=root-ca" \ |
| 77 | + --set "volumes[0].secret.secretName=istio-root-ca" |
| 78 | +``` |
38 | 79 |
|
39 | | -Finally, install istio. Istio must be installed using the IstioOperator |
40 | | -configuration changes within |
41 | | -[`./hack/istio-config-x.yaml`](./hack/istio-config-1.10.0.yaml). |
42 | | -For OpenShift set the profile as `--set profile=openshift` |
| 80 | +All helm value options can be found [here](./deploy/charts/istio-csr/README.md). |
43 | 81 |
|
44 | | -These changes are required in order for the CA Server to be disabled in istiod, ensure istio |
45 | | -workloads request certificates from the cert-manager agent, and the istiod |
46 | | -certificates and keys are mounted in from the Certificate created earlier. |
| 82 | +### Installing Istio |
47 | 83 |
|
| 84 | +If you are running Openshift, prepare the cluster for Istio. |
| 85 | +Follow instructions from Istio [platform setup |
| 86 | +guide](https://istio.io/latest/docs/setup/platform-setup/openshift/). |
48 | 87 |
|
49 | | -## How |
| 88 | +Finally, install Istio. Istio must be installed using the IstioOperator |
| 89 | +configuration changes within |
| 90 | +[`./hack/istio-config-x.yaml`](./hack/istio-config-1.10.0.yaml). Later versions |
| 91 | +of Istio share the same config. |
50 | 92 |
|
51 | | -The cert-manager istio agent implements the gRPC istio certificate service, |
52 | | -which authenticates, authorizes, and signs incoming certificate signing requests |
53 | | -from istio workloads. This matches the behaviour of istiod in a typical |
54 | | -installation, however enables these certificates to be signed through |
55 | | -cert-manager. |
| 93 | +For OpenShift set the profile as `--set profile=openshift`. |
56 | 94 |
|
57 | | ---- |
| 95 | +These config options are required in order for the CA Server to be disabled in |
| 96 | +istiod, ensure Istio workloads request certificates from istio-csr, and the |
| 97 | +istiod certificates and keys are mounted from the Certificate created when |
| 98 | +installing istio-csr. |
58 | 99 |
|
59 | | -## Testing |
60 | 100 |
|
61 | | -To run the end to end tests, run; |
| 101 | +## How |
62 | 102 |
|
63 | | -```bash |
64 | | -$ make e2e |
65 | | -``` |
| 103 | +The cert-manager Istio agent implements the gRPC Istio certificate service which |
| 104 | +authenticates, authorizes, and signs incoming certificate signing requests from |
| 105 | +Istio workloads. This matches the behaviour of istiod in a typical installation, |
| 106 | +however enables these certificates to be signed through cert-manager. |
0 commit comments