Automating SSL Certificates in Kubernetes with Let’s Encrypt and ClusterIssuer Helm Charts
Now that we have a working k8s cluster with observability via Datadog, as we saw in Opting for Dual State in Terraform OCI OKE, we'll deploy a simple Hello World app that uses Let's Encrypt to automatically generate SSL certificates for our Kubernetes services.
Add Cluster SSL Issuer to the infra layer
Let's start by adding the cluster manager and issuer to our Terraform deployment:
Deploy an HTTPS Hello World App
With the help of the issuer we added in the previous step, we can deploy a Hello World app. We'll use Terraform's HTTP echo server to demonstrate this:
Helm Chart for the Hello World App
In the Helm chart for the Hello World app, you can see attributes that are used to configure the app to use the cluster issuer we added in the previous step:
Pass the cluster issuer name to the cert-manager.io/cluster-issuer annotation and specify the secret name that will hold the TLS certificate.
Source Code
You can find the complete source code for this example in the GitLab Helm Examples Repository.
For Terraform, check out the helm_releases.tf configuration file.