From 22bd06b33f914e406bba9ce9690e92cc3f5c3226 Mon Sep 17 00:00:00 2001 From: tommie Date: Wed, 31 May 2023 20:24:41 +0200 Subject: [PATCH] docs: add user/tls-cert-manager.md (#1461) * docs: Add user/tls-cert-manager.md. This shows how to set up cert-manager to work with Envoy Gateway. Signed-off-by: Tommie Gannert * docs: fixes grammar and adds ACME console output in tls-cert-manager Signed-off-by: Tommie Gannert --------- Signed-off-by: Tommie Gannert --- docs/latest/user/tls-cert-manager.md | 425 +++++++++++++++++++++++++++ docs/latest/user_docs.rst | 1 + 2 files changed, 426 insertions(+) create mode 100644 docs/latest/user/tls-cert-manager.md diff --git a/docs/latest/user/tls-cert-manager.md b/docs/latest/user/tls-cert-manager.md new file mode 100644 index 00000000000..1082a2d63b0 --- /dev/null +++ b/docs/latest/user/tls-cert-manager.md @@ -0,0 +1,425 @@ +# Using cert-manager For TLS Termination + +This guide shows how to set up [cert-manager](https://cert-manager.io/) to automatically create certificates and secrets for use by Envoy Gateway. +It will first show how to enable the self-sign issuer, which is useful to test that cert-manager and Envoy Gateway can talk to each other. +Then it shows how to use [Let's Encrypt's staging environment](https://letsencrypt.org/docs/staging-environment/). +Changing to the Let's Encrypt production environment is straight-forward after that. + +## Prerequisites + +* A Kubernetes cluster and a configured `kubectl`. +* The `helm` command. +* The `curl` command or similar for testing HTTPS requests. +* For the ACME HTTP-01 challenge to work + * your Gateway must be reachable on the public Internet. + * the domain name you use (we use `www.example.com`) must point to the Gateway's external IP(s). + +## Installation + +Follow the steps from the [Quickstart Guide](quickstart.md) to install Envoy Gateway and the example manifest. +Before proceeding, you should be able to query the example backend using HTTP. + +## Deploying cert-manager + +*This is a summary of [cert-manager Installation with Helm](https://cert-manager.io/docs/installation/helm/).* + +Installing cert-manager is straight-forward, but currently (v1.12) requires setting a feature gate to enable the Gateway API support. + +```console +$ helm repo add jetstack https://charts.jetstack.io +$ helm upgrade --install --create-namespace --namespace cert-manager --set installCRDs=true --set featureGates=ExperimentalGatewayAPISupport=true cert-manager jetstack/cert-manager +``` + +You should now have `cert-manager` running and having nothing to do: + +```console +$ kubectl wait --for=condition=Available deployment -n cert-manager --all +deployment.apps/cert-manager condition met +deployment.apps/cert-manager-cainjector condition met +deployment.apps/cert-manager-webhook condition met + +$ kubectl get -n cert-manager deployment +NAME READY UP-TO-DATE AVAILABLE AGE +cert-manager 1/1 1 1 42m +cert-manager-cainjector 1/1 1 1 42m +cert-manager-webhook 1/1 1 1 42m +``` + +## A Self-Signing Issuer + +cert-manager can have any number of *issuer* configurations. +The simplest issuer type is [SelfSigned](https://cert-manager.io/docs/configuration/selfsigned/). +It simply takes the certificate request and signs it with the private key it generates for the TLS Secret. + +To install self-signing, run + +```console +$ kubectl apply -f - <