Traefik Ingress(Kubernetes)没有收到letsencrypt证书

问题描述 投票:3回答:2

我用let'sencrypt ACME配置了Traefik(掌舵图),但我没有收到任何证书。 Traefik Ingress在80和443端口上网。

traifik.toml

logLevel = "INFO"
InsecureSkipVerify = true
defaultEntryPoints = ["http","https"]
[entryPoints]
  [entryPoints.http]
  address = ":80"
  compress = true
  [entryPoints.https]
  address = ":443"
  compress = true
    [entryPoints.https.tls]
      [[entryPoints.https.tls.certificates]]
      CertFile = "/ssl/tls.crt"
      KeyFile = "/ssl/tls.key"
[kubernetes]
[acme]
email = "[email protected]"
storage = "/acme/acme.json"
entryPoint = "https"
onHostRule = true
caServer = "https://acme-staging-v02.api.letsencrypt.org/directory"
acmeLogging = true
  [acme.httpChallenge]
  entryPoint = "http"
[web]
address = ":8080"

与Traefik一起进入IngressClass

{
  "kind": "Ingress",
  "apiVersion": "extensions/v1beta1",
  "metadata": {
    "name": "domain",
    "namespace": "reverse-proxy",
    "selfLink": "/apis/extensions/v1beta1/namespaces/reverse-proxy/ingresses/domain",
    "uid": "550cdedc-ba77-11e8-8657-00155d00021a",
    "resourceVersion": "6393921",
    "generation": 5,
    "creationTimestamp": "2018-09-17T12:43:52Z",
    "annotations": {
      "ingress.kubernetes.io/ssl-redirect": "true",
      "kubernetes.io/ingress.class": "traefik"
    }
  },
  "spec": {
    "tls": [
      {
        "hosts": [
          "domain.com"
        ],
        "secretName": "cert" // without is also not working
      }
    ],
    "rules": [
      {
        "host": "domain.com",
        "http": {
          "paths": [
            {
              "backend": {
                "serviceName": "domain",
                "servicePort": 443
              }
            }
          ]
        }
      },
      {
        "host": "www.domain.com",
        "http": {
          "paths": [
            {
              "backend": {
                "serviceName": "www-domain",
                "servicePort": 443
              }
            }
          ]
        }
      }
    ]
  },
  "status": {
    "loadBalancer": {}
  }
}

我试过使用http-01和tls-sni-01挑战。 dns-01是没有选项,因为我的DNS提供商没有API。

kubernetes traefik traefik-ingress
2个回答
2
投票

你如何将letsencrypt配置注入你的traefik Ingress服务/守护进程?

Traefik没有正式对Kubernetes Ingress文档进行过密切关注。但这是一个good guide。寻找“外部Traefik入口控制器”,您需要一个kv后端来存储您的证书。

您也可以尝试与Traefik合作的cert-manager


0
投票

建议不要在Kubernetes上使用内置的ACME对Traefik的支持,因为设置故障转移/冗余变得困难。如Rico所述,Cert-manager是一个更好的解决方案,也是Traefik团队目前推荐的:)

© www.soinside.com 2019 - 2024. All rights reserved.