Hydrolix ACME Client
Overview⚓︎
Hydrolix includes software for automatic certificate acquisition and renewal.
This is the default and recommended option for managing TLS in a Hydrolix cluster. See Enable TLS for more TLS options.
The TLS industry has adopted a standard called Automatic Certificate Management Environment (ACME) which can be supported by a Certification Authority (CA).
This page describes how to use the ACME client in a Hydrolix cluster for automated provisioning of TLS certificates.
The Hydrolix implementation automates sourcing certificates from the Let's Encrypt CA using the Lego project.
Prerequisites⚓︎
Before you can start this guide, you'll need the following:
- A deployed Hydrolix cluster
- A publicly reachable IP address on the cluster
- An active DNS record for the cluster's name
Request a certificate⚓︎
Request a certificate with only exact-match hostnames. Wildcards aren't supported. This uses HTTP-01 validation with the CA.
- Confirm hostnames.
- Remove existing certificates by dropping the
traefik-tlsKubernetes secret. - Prepare for HTTP-01 validation.
- Set the tunable
acme_enabledtotruein your Hydrolix cluster manifest. - Apply the changes to the Hydrolix cluster manifest.
- Monitor the
acmeservice. - Verify certificate and reachability.
Request a certificate with a wildcard hostname derived from the cluster name. This uses DNS-01 validation with the CA.
- Confirm hostnames.
- Remove existing certificates by dropping the
traefik-tlsKubernetes secret. - Configure for DNS-01 validation.
- Set the tunables
acme_enabledandissue_wildcard_certtotruein your Hydrolix cluster manifest. - Apply the changes to the Hydrolix cluster manifest.
- Monitor the
acmeservice. - Verify certificate and reachability.
Confirm hostnames⚓︎
These tunables set the TLS hostnames used when requesting a certificate. They become certificate's Subject Alternative Names (SANs).
- Confirm spelling of
hydrolix_url. This is the primary name on the certificate request. - Set
issue_wildcard_certto include a wildcard TLS hostname derived from thehydrolix_url. - Confirm spelling of all
alt_names, if you are using them. These are additional names to be included in the certificate request.
Remove existing certificates⚓︎
Removing certificates causes TLS termination to break
The Traefik reverse proxy loads a self-signed default certificate when the traefik-tls secret is absent. Clients won't be able to validate this default certificate.
New connections fail until a certificate is successfully provisioned or installed. Existing connections remain open.
-
Remove the
traefik-tlssecret. When absent, theacmeservice requests a certificate. -
(optional) Remove the
acme-accountsecret. When absent, theacmeservice creates a new account with the CA using the email address inadmin_email.
Configure DNS-01 validation⚓︎
ACME specification requires DNS-01 to validate wildcard hostnames. Hydrolix supports only AWS Route53 as an acme_dns_provider for installing the challenge tokens.
-
Create an IAM policy granting minimal permissions. Replace
{hosted-zone-id}and_acme-challenge.hostname.hydrolix.livewith the Route53 hosted zone ID and the Hydrolix cluster hostname in this example IAM policy.Example IAM policy
- This is the fully qualified domain name (FQDN) the CA looks up when using DNS to validate a wildcard TLS hostname. The Hydrolix ACME client manipulates the TXT DNS record
_acme-challenge.hostname.hydrolix.liveto prove control over the TLS hostname*.hostname.hydrolix.live. - Use the hosted zone ID of the Route53 zone holding the
_acme-challengeFQDN.
- This is the fully qualified domain name (FQDN) the CA looks up when using DNS to validate a wildcard TLS hostname. The Hydrolix ACME client manipulates the TXT DNS record
-
Attach the policy to a user by adding IAM identity permissions. This can be done directly or by attaching to an identity (user group, role) that includes the user.
-
Use the AWS Guide to create a new IAM access key and secret.
-
In
hydrolixcluster.yamlconfiguration, setissue_wildcard_cert: true. This switches theacmeservice to use DNS-01 validation. -
Create additional entries in the
curatedsecret holding the access key ID and secret access key generated for the AWS user. Set the AWS region and hosted zone ID corresponding to your Route53 configuration.
Monitor the acme service⚓︎
-
Watch the
acmelogs. Use any Kubernetes log tooling. -
(optional) Restart the
acmeservice.
See also Logging examples.
Verify certificate⚓︎
To verify successful storage and server installation of the certificate, use the following commands.
This is a successful connection. TLS failures generate non-zero exits.
All certificate hostnames are listed in the Subject Alternative Names field. Not After is the expiration date.
Configuration⚓︎
Hydrolix uses Let's Encrypt as the preferred CA. Use a different CA by setting acme_provider tunable to the provider's URL.
The Hydrolix ACME client supports HTTP-01 and DNS-01. The ACME specification requires DNS-01 validation for wildcard hostnames.
Certificate validity period depends on the CA. The service checks regularly for upcoming expiration and renews early.
Certificate key type⚓︎
Hydrolix version 6.3 and later supports elliptic-curve keys. Set traefik_tls_key_type to choose the private key type the CA issues. The default is RSA2048.
| Value | Key |
|---|---|
EC256 |
Elliptic curve, P-256 |
EC384 |
Elliptic curve, P-384 |
RSA2048 |
RSA, 2048-bit (default) |
RSA3072 |
RSA, 3072-bit |
RSA4096 |
RSA, 4096-bit |
RSA8192 |
RSA, 8192-bit |
The operator rejects any other value.
HTTP-01 validation⚓︎
By default, HTTP-01 validation is used. All hostnames must be exact match, no wildcards.
The acme service retrieves the challenge token from the CA and serves the token from URL https://hostname.hydrolix.live/.well-known/acme-challenge/<TOKEN>.
Using HTTP-01 validation isn't compatible with a strict ip_allowlist
The CA must be able to reach the token challenge URL to validate control of the domain.
When ip_allowlist is used, the external load balancer only allows incoming connections from IPs matching the list. This can block the CA's validation requests. Avoid this blockage by installing permissive 0.0.0.0/0 in the external load balancer ip_allowlist.
To enforce strict IP controls, use the in-cluster Traefik IP Allowlist instead of the external load balancer ip_allowlist.
This cluster-level IP access control list always allows the ACME HTTP-01 challenge requests.
DNS-01 validation⚓︎
When issue_wildcard_cert=true, a wildcard hostname is formed from the hostname in the hydrolix_url and DNS-01 validation is used.
The acme service installs the challenge tokens using API access to the acme_dns_provider. The only valid provider is route53.
ACME client process⚓︎
The tunable acme_enabled signals the operator to start the acme service.
Hostname collection⚓︎
The acme software collects hostnames from these configuration settings to include in the certificate request.
- the hostname from
hydrolix_url - all hostnames in
alt_names - if
issue_wildcard_certis true, a wildcard hostname derived fromhydrolix_url
Runtime behavior⚓︎
The process in the acme pod initiates a certificate request
- if there's no current certificate in
traefik-tlssecret - if the current certificate doesn't cover all the collected names
- if the current certificate expires sooner than
acme_renew_certs_with_expiry_daysdays, which defaults to 30
The acme service interacts with the acme_provider to request a certificate, install the challenge for validation, collect the issued certificate, and store it in the traefik-tls Kubernetes secret.
Upon failure, the acme process attempts again after 15 minutes. A higher frequency of attempts risks exceeding the CA's validation limits, which apply per-hour, per-hostname.
Expiration and monitoring⚓︎
The acme service checks remaining certificate validity every acme_cert_check_interval_in_minutes and initiates a certificate request when the certificate expires sooner than acme_renew_certs_with_expiry_days.
The cert-expiry-check daily cronjob updates the number of seconds the traefik-tls certificate remains valid as metric fqdn_cert_expiry.
Hydrolix doesn't provide any email notification of certificate expiration.
Troubleshoot⚓︎
There are some specific troubleshooting steps when using the Hydrolix acme-client and also common Certificate Troubleshooting tips.
- Check the hostname for spelling errors and correct any mistakes.
- Verify a successful DNS lookup to one or more DNS resolvers for the hostname.
- Confirm from your workstation with the
host $HDX_HOSTNAMEcommand; if it fails, confirm that the authoritative DNS entry is present. - Confirm using a public resolver with the command
host $HDX_HOSTNAME 8.8.8.8. If it fails, diagnose and resolve the authoritative DNS issue. - Confirm the
acmepod is running, see Monitor the acme service. - If using HTTP-01 validation, see Enforce IP access controls.
Enforce IP access controls⚓︎
See Configure IP Access to adjust the IP access control list installed in the external load balancer. HTTP-01 validation isn't compatible with a strict ip_allowlist.
See Traefik IP Allowlist to configure the IP access control list installed in the Traefik reverse proxy. HTTP-01 requests are always allowed.
Logging examples⚓︎
When no certificate exists in traefik-tls, the service begins the certificate request process. In this example, issue_wildcard_cert was true and the DNS-01 challenge is used.
ACME Pod Startup with No Certificate, Acquire New Certificate
When a certificate already exists in traefik-tls and covers all of the names collected for the cluster, the service sleeps. It doesn't issue a new certificate request.
ACME Pod Startup with Existing Certificate, No Action
The acme client verifies HTTP reachability of the challenge endpoint by initiating a request from an external IP, to simulate an arbitrary source IP. It doesn't begin the certificate request process unless the HTTP-01 ACME challenge test succeeds.
When acme discovers a name during Hostname collection not present on the certificate, it begins a new certificate request.