I'm trying to set up the Traefik Helm chart in Kubernetes to get a Let's Encrypt TLS/HTTPS certificate and use it for an IngressRoute, but whenever I add the Proxy Protocol stuff to preserve client IP addresses as per Civo's docs (the trustedIPs, annotations, and externalTrafficPolicy), it stops working, and I get the following in the Traefik logs:
2025-04-22T13:09:33Z ERR Unable to obtain ACME certificate for domains error="unable to generate a certificate for the domains [dashboard.example.blue]: error: one or more domains had a problem:\n[dashboard.example.blue] inv.alid authorization: acme: error: 400 :: urn:ietf:params:acme:error:connection :: 74.220.25.170: Fetching http://dashboard.example.blue/.well-known/acme-challenge/DN4ggaxOm7FlVZiHQqiGe4-x9lN1EJkHA5n6TymfkJ4: Error getting validation data\n" ACME CA=https://acme-staging-v02.api.letsencrypt.org/directory acmeCA=https://acme-staging-v02.api.letsencrypt.org/directory domains=["dashboard.example.blue"] providerName=staging.acme routerName=websecure-dash-drupal-42da837a8cc7a01b7ea1@kubernetescrd rule=Host(dashboard.example.blue)
Also:
% curl -I http://dashboard.example.blue
HTTP/1.1 502 Server Hangup
% curl -I https://dashboard.example.blue
curl: (35) error:0A000126:SSL routines::unexpected eof while reading
Here's the Terraform code (I didn't include the IngressRoute kubernetes_manifest resource because that doesn't change):
resource "helm_release" "traefik" {
name = "traefik"
namespace = kubernetes_namespace.drupal_dashboard.metadata[0].name
repository = "https://traefik.github.io/charts"
chart = "traefik"
version = var.traefik_helm_chart_version
values = [
yamlencode({
additionalArguments = [
"--entryPoints.web.address=:${var.http_port}",
"--entryPoints.web.proxyProtocol.trustedIPs=${join(",", ["0.0.0.0/0"])}",
"--entryPoints.websecure.address=:${var.https_port}",
"--entryPoints.websecure.proxyProtocol.trustedIPs=${join(",", ["0.0.0.0/0"])}"
]
service = {
annotations = {
"kubernetes.civo.com/loadbalancer-enable-proxy-protocol" = "send-proxy-v2"
"kubernetes.civo.com/firewall-id" = var.firewall_id_annotation_value
}
spec = {
externalTrafficPolicy = "Local"
}
}
certificatesResolvers = {
(var.letsencrypt_staging_environment_name) = {
acme = {
caServer = "https://acme-staging-v02.api.letsencrypt.org/directory"
email = var.technical_contact_email
storage = local.tls_certificate_data_path
httpChallenge = {
entryPoint = "web"
}
}
}
(var.letsencrypt_production_environment_name) = {
acme = {
caServer = "https://acme-v02.api.letsencrypt.org/directory"
email = var.technical_contact_email
storage = local.tls_certificate_data_path
httpChallenge = {
entryPoint = "web"
}
}
}
}
})
]
}
Anyone have any ideas what's going wrong?