|
| 1 | +# Letsencrypt support for Validated patterns |
| 2 | + |
| 3 | +This is an *EXPERIMENTAL* and *UNSUPPORTED* chart to enable letsencrypt support in the pattern. |
| 4 | +Currently the only supported cloud for this is AWS. |
| 5 | + |
| 6 | +In order to enable this chart in your patterns, please add and edit the following lines to `values-AWS.yaml`: |
| 7 | + |
| 8 | + letsencrypt: |
| 9 | + region: eu-central-1 # region of the cluster |
| 10 | + server: https://acme-v02.api.letsencrypt.org/directory |
| 11 | + # staging URL |
| 12 | + # server: https://acme-staging-v02.api.letsencrypt.org/directory |
| 13 | + email: foo@bar.it |
| 14 | + |
| 15 | + clusterGroup: |
| 16 | + applications: |
| 17 | + letsencrypt: |
| 18 | + name: letsencrypt |
| 19 | + namespace: letsencrypt |
| 20 | + project: default |
| 21 | + path: common/letsencrypt |
| 22 | + |
| 23 | +Once the above is enabled in a pattern, a certain amount of time (~15/20 minutes or so) is needed for all the cluster operators to settle, all the HTTPS routes will have a wildcard certificate signed by letsencrypt. By default also the API endpoint will use a certificate signed by letsencrypt. |
| 24 | + |
| 25 | +## Limitations |
| 26 | + |
| 27 | +Please be aware of the following gotchas when using this chart: |
| 28 | + |
| 29 | +1. Once the API certificate has been replaced with the letsencrypt one, the `oc` commands might fail with x509 unknown certificate authority errors. |
| 30 | + You need to remove the previous CA from the kubeconfig file. Run: `oc config set-cluster <clustername> --certificate-authority="/dev/null" --embed-certs` |
| 31 | +2. When you switch to non-staging letsencrypt certificates, things might fail if you asked for too many certificates over the last few days. |
| 32 | +3. The cluster takes ~20-30 mins to fully settle when both the API endpoint and the default ingress certificates are implemented |
| 33 | + |
| 34 | +## Implementation |
| 35 | + |
| 36 | +This chart creates a Cloud Credential that is allowed to write and read DNS entries via Route53 in AWS. That credential is then used by cert-manager to prove ownership of the DNS zone and answer the ACME DNS01 challenges. |
| 37 | +We ask for a single wildcard certificate for the default Ingress *.apps.domain and one non-wildcard certificate for the API endpoint api.domain. |
| 38 | +We use Argo's Server-Side Apply feature to patch in the Ingress Controller and the API endpoint certificates. |
| 39 | +Currently we also patch the main cluster-wide Argo instance to set the tls route to `reencrypt` in order have a proper cert there. Once issue 297 in the gitops-operator repository is fixed, we can drop that. |
| 40 | + |
| 41 | +## Parameters |
| 42 | + |
| 43 | +### global parameters |
| 44 | + |
| 45 | +This section contains the global parameters consumed by this chart |
| 46 | + |
| 47 | +| Name | Description | Value | |
| 48 | +| --------------------------- | ---------------------------------------------------------------------------------------------------- | ------------------ | |
| 49 | +| `global.localClusterDomain` | String containing the domain including the apps. prefix. Gets set by the Validated Pattern framework | `apps.example.com` | |
| 50 | + |
| 51 | +### letsencrypt parameters |
| 52 | + |
| 53 | +This section contains all the parameters for the letsencrypt |
| 54 | +chart in order to request CA signed certificates in a Validated Pattern |
| 55 | + |
| 56 | +| Name | Description | Value | |
| 57 | +| -------------------------------- | --------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------- | |
| 58 | +| `letsencrypt.enabled` | Boolean to enable this feature and request a wildcard cert for the default Infress (*.apps.domain) (defaults to True) | `true` | |
| 59 | +| `letsencrypt.api_endpoint` | Boolean to enable letsencrypt certs on the API endpoint too (defaults to True) | `true` | |
| 60 | +| `letsencrypt.region` | String that defines the region used by the route53/dns01 resolver in cert-manager (required) | `eu-central-1` | |
| 61 | +| `letsencrypt.email` | String containing the email used when requesting certificates to letsencrypt (required) | `test@example.com` | |
| 62 | +| `letsencrypt.server` | String containing the letsencrypt ACME URL (Defaults to the staging server) | `https://acme-staging-v02.api.letsencrypt.org/directory` | |
| 63 | +| `letsencrypt.organizations` | List of organization names to be put in a certificate (Defaults to [hybrid-cloud-patterns.io]) | `["hybrid-cloud-patterns.io"]` | |
| 64 | +| `letsencrypt.usages` | List of certificate uses. See API cert-manager.io/v1.KeyUsage (Defaults to [server auth]) | `["server auth"]` | |
| 65 | +| `letsencrypt.duration` | Duration of the requested letsencrypt certificates (Defaults to 168h0m0s) | `168h0m0s` | |
| 66 | +| `letsencrypt.renewBefore` | How long before expiration date should the certs be renewed (Defaults to 28h0m0s) | `28h0m0s` | |
| 67 | +| `letsencrypt.nameservers` | List of DNS server (ip:port strings) to be used when doing DNS01 challenges (Defaults to [8.8.8.8:53, 1.1.1.1:53]) | `["8.8.8.8:53","1.1.1.1:53"]` | |
| 68 | +| `letsencrypt.certmanagerChannel` | String the channel to install cert-manager from (Defaults to "stable-v1") | `stable-v1` | |
0 commit comments