Follow the instructions in this guide to replace the Kubernetes Ingress Controller Fake Certificate
default cert which ingress-nginx
serves over 443/tcp (HTTPS) by default.
After following this doc, all deployments receiving Akash Provider hostnames within *.ingress.<yourdomain>
or *.<yourdomain>
will automatically have the wildcard Let’s Encrypt certificate. This will ensure that users interacting with such deployments will not receive self signed certificate warnings.
- Install Let’s Encrypt Cert Manager
- Configure the Issuer
- Google Cloud OR Cloudflare Configuration
- Wildcard Certificate Request
- Ingress Controller Wildcard Cert Use
- Optional Step - Certs for Custom Domains
Install Let’s Encrypt Cert Manager
Steps to Install the Let’s Encrypt Cert Manager
NOTE - perform the steps in this guide on an Akash control plane node with Helm installed
Add the Let’s Encrypt Helm Repo
Install the Let’s Encrypt Helm Chart
Expected/Example Output
Configure the Issuer
Initial Cert Manager Configuration
NOTE - If you want to use the namespaces then configure Issuer instead of the ClusterIssuer.
Update Solvers Section of the Cert Manager Configuration
For wildcard certs you have to use the DNS-01 type of the challenge.
Additional details from Let’s Encrypt:
We can use either Google Cloud or Cloudflare as the DNS solver. Subsequent sections of this guide will use Google Cloud DNS for this purpose but we provide both examples below for reference.
Google Cloud DNS Additions
Additional details from Google Cloud on DNS usage are found here.
- Add the following section in the
solvers
section of yourcert-manager-values.yaml
file.
NOTE - see this section for a full
cert-manager-values.yaml
YAML file example
CloudFlare DNS Additions
Additional details from CloudFlare on DNS usage are found here.
- Add the following section in the
solvers
section of yourcert-manager-values.yaml
file.
NOTE - see these section for a full cert-manager-values.yaml YAML file example
Complete cert-manager-values.yaml YAML File Example
Google DNS Example
- Fully populated
cert-manager-values.yaml
manifest using the Google Cloud DNS example
CloudFlare DNS Example
- Fully populated
cert-manager-values.yaml
manifest using the CloudFlare DNS example
Apply Manifest
Once your cert-manager-values.yaml
is configured properly and based on the guidance above, apply the manifest to your Kubernetes cluster.
Google Cloud OR Cloudflare Configuration
NOTE - both the use of Google Cloud and Cloudflare DNS configurations are presented in this section. Only complete one of these paths based on DNS prefered platform.
Create the Google DNS Cloud Service Account for DNS-01 Challenge
NOTE - the actions in this section should be performed in your Google Cloud console instance
STEP 1 - Create Role
NOTE - additional information on the configuration of the settings covered in this section can be found here
STEP 2 - Create Service Account
NOTE - additional information on the configuration of the settings covered in this section can be found here
STEP 3 - Create Service Account (SA) Key for dns01-solver SA
NOTE - additional information on the configuration of the settings covered in this section can be found here
Download the Service Account Key from Google Cloud
- First download the service account key in JSON
- Then encode the service account key in base64
Apply the Secret on your Provider Cluster
NOTE - this step should be performed on one of the Kubernetes control plane nodes of your Akash Provider
Create the Service Account Secret Config File
- Replace the service account key field with your own key
Apply the Service Account Secret Config
Create the Cloudflare DNS Cloud Service Account for DNS-01 Challenge
- If using Cloudflare for DNS then request your API token and then create the following secret:
API Tokens are recommended for higher security, since they have more restrictive permissions and are more easily revocable. Tokens can be created at User Profile > API Tokens > API Tokens. The following settings are recommended:
NOTE - this step should be performed on one of the Kubernetes control plane nodes of your Akash Provider
Create the DNS Challenge Config
Apply the DNS Challenge Config
Wildcard Certificate Request
Request the Wildcard Certificate for your Domain
NOTE - replace the domain bits with yours accordingly. Leave the *.ingress. bit (or adjust to the one you are using for the ingress address deployments receive) since wildcards aren’t working for sub-sub domain (RFC 2818).
NOTE - this step should be performed on one of the Kubernetes control plane nodes of your Akash Provider
Create the Wildcard Cert Config
Apply the Wildcard Cert Config
Additional Detail
Additional notes on the wildcard certifcate request from Let’s Encrypt can be found here.
Ingress Controller Wildcard Cert Use
Overview
The steps in section replace the Kubernetes Ingress Controller Fake Certificate default cert ingress-nginx
serves over 443/tcp (HTTPS) by default to all clients who do not have the certs explicitly set.
Update the ingress-nginx-custom.yaml Config File
Update the ingress-nginx-custom.yaml
file - originally created when installing your Akash Provider ingress controller in this guide/step - with this extra argument:
Update the Ingress Controller
Use the helm upgrade
command - same syntax which was used in the original install of the ingress-nginx
chart and detailed here - to apply the changes.
Verification
After following this doc, all deployments receiving their hostnames within *.ingress.<yourdomain>
or *.<yourdomain>
will automatically have the wildcard LE (Let’s Encrypt) cert!
Verify by issuing (replace yourdomain
with the actual domain):
Expected/Example Output
NOTE - If you still get Kubernetes Ingress Controller Fake Certificate at this point, it is likely the
ingress-nginx
did not pick-up the cert or the cert hasn’t been issued by the cert-manager.
Troubleshooting
Verify Certificates by Issuer
NOTE - following install this command will likely output No resources found which is expected and can be ignored. Revisit this command later and when certs have been generated by the issuer to view output.
Optional Step - Certs for Custom Domains
In this section we detail the use of Let’s Encrypt for custom domains served by your provider. The prior steps in this guide enabled use of Let’s Encrypt for Akash provider generated domains. This section details the optional step of enabling Let’s Encrypt for domains specified in the accept
field of an Akash deployment’s SDL.
Pros/Cons of Custom Domain Let’s Encrypt Configuration
Pros of Using Let’s Encrypt for Custom Domains
- No API key/token is required since no
DNS-01
ACME challenge is used - Users will be able to have their custom domains signed by the Let’s Encrypt
- The certs will automatically renew every 45-60 days by the cert-manager
- Users do not have to send/share their domain API key/token with the provider at all (based on the HTTP-01 ACME challenge)
Cons of Using Let’s Encrypt for Custom Domains
- No wildcard support since it’s done via HTTP-01 ACME challenge; (the wildcard certs require DNS-01 ACME challenge and so the domain’s API key/token)
Configuration of Custom Domains
NOTE - the steps in this section must be followed for each individual custom domain desired to support
STEP 1 - Ensure the CNAME of the Deployment Points to Provider Worker Node
- The CNAME of the deployment must be point to one of the provider worker nodes
- Verify by conducting these actions:
Gather the Custom Domain for the Deployment
The CNAME is tetris.decloud.pro
in this example:
Conduct DNS Dig to Confirm CNAME is Pointing to Provider Worker Node
Example dig verification:
STEP 2 - Ingress Controller Annotation and Patch
NOTE - this is something Akash does not do out-of-the-box currently.
NOTE - this step should be performed on one of the Kubernetes control plane nodes of your Akash Provider
STEP 3 - Verification
- Verify that Let’s Encrypt issued the x509 cert for
tetris.decloud.pro
based on the example custom domain - Replace the domain name with your own custom domains added