cert-manager-configs

by joaquinito2051

Helm chartv0.1.2App v0.1.1

A Helm chart for installing customizations to the cert-manager deployment

About this chart

cert-manager-configs for Openshift

Helm Templates Approach

This helm chart is meant to provide auto-renewing Let's Encrypt on your api and *.apps endpoints on Openshift. **This requires ClusterAdmin privileges and expects you to install Cert-Manager prior to this chart ** to an OCP 4.x cluster as you will be installing CRDs and touching critical networking pieces. You will also need to be able control your DNS to create the ACME challenges if using the DNS01 ACME Challenge.

It is recommended that you do not enable the cluster.apiServer and cluster.ingressController resources until you have successfully installed cert-manager and configured your issuers to generate valid certs.

Install cert-manager and CRDs

Install cert-manager following the installation instructions for Helm v3:

oc new-project cert-manager

helm repo add jetstack https://charts.jetstack.io
helm repo update
helm install \
  cert-manager jetstack/cert-manager \
  --namespace cert-manager \
  --version v1.9.0 \
  --set installCRDs=true \
  --set 'extraArgs={--dns01-recursive-nameservers=8.8.8.8:53\,1.1.1.1:53}'

Note the dns01-recursive-nameservers option above is required in most cases for Route53. By default, cert-manager will check dns with /etc/resolv.conf before creating a CertificateRequest, which is undesirable if your node is not pointed to public DNS nameservers. The dns01-recursive-nameservers is only applicable if you want to use DNS01 ACME Challenge, if you want to utilize HTTP01 you will need to use acme-http01-solver-nameservers parameter instead.

Install ClusterIssuer/Issuer and Certificates

Once cert-manager is up and running, use helm to install to install your issuers, create certificates, and point your APIServer and IngressController to the automatically renewable certificates:

While the cert-manager install can be done with mostly default values, these configs require custom values, including DNS secrets in values.yaml before you can apply the configs.

helm template cert-manager-configs -f charts/cert-manager-configs/values.yaml ./charts/cert-manager-configs | oc apply -f -

Configuration

See comments in values.yaml for more details on configuration

ParameterDescriptionDefault
namespaceProject name to install cert-managercert-manager
issuer.solverConfigure a solver (ACME Challenge) type for an Issuer or ClusterIssuerDNS01
issuer.providerConfigure an Issuer or ClusterIssuer for cert-manager, only needed for DNS01 solverroute53
issuer.dns.enabledEnable DNS providertrue
issuer.acme.emailAddressEmail address for ACME account[email protected]
issuer.acme.selectorZonesLimit DNS watch zones["subdomain.example.com]
issuer.acme.issuerKindIssuer or ClusterIssuerClusterIssuer
aws.accessKeyIdConfigure AWS Access Key Id''
aws.secretAccessKeyConfigure AWS Secret Access Key''
aws.regionConfigure AWS Regionus-east-1
rfc2136.dnsNameServerDNS server address''
rfc2136.tsigKeyAlgorithmTSIG Key Algorithmhmac256
rfc2136.tsigKeyNameKey name used with dnssec-keygen''
certificates.apiServer.nameConfigure APIServer certficate secret nameapi-letsencrypt-cert
certificates.apiServer.namespaceConfigure APIServer certficate secret namespaceopenshift-config
certificates.apiServer.issuerRefSelect APIServer issuerletsencrypt-staging
certificates.apiServer.issuerKindSelect APIServer issuer kindClusterIssuer
certificates.apiServer.dnsNamesConfigure APIServer DNS names["api.example.com"]
certificates.ingressController.nameConfigure IngressController certficate secret nameingress-letsencrypt-cert
certificates.ingressController.namespaceConfigure IngressController certficate secret namespaceopenshift-config
certificates.ingressController.issuerRefSelect IngressController issuer kindletsencrypt-staging
certificates.ingressController.issuerKindSelect IngressController issuer kindClusterIssuer
certificates.ingressController.dnsNamesConfigure IngressController DNS names["api.example.com"]
cluster.apiServer.enabledEnable APIServer ACME certificatesfalse
cluster.apiServer.nameConfigure apiServer endpointapi.example.com
cluster.apiServer.tlsSecretAPIServer secret name created in certificates.apiServer.nameapi-letsencrypt-cert
cluster.ingressController.enabledEnable ACME wildcard IngressController certificatesfalse
cluster.caBundleGet latest Let's Encrypt CA and drop it here''

Deploy cert-manager-configs with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has cert-manager-configs on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartcert-manager-configs is pinned at v0.1.2 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply