0

我的网站不使用 LetsEncrypt 生成任何 HTTP 证书,甚至不返回响应。这是出于测试目的,因此使用我想通过 HTTPS 提供的基本 NGINX 图像。

我有一个看起来像这样的入口类型:

   apiVersion: v1
kind: Service
metadata:
  name: nginxtest
  labels:
    app: nginx
spec:
  selector:
    k8s-app: traefik-ingress-lb
  ports:
    - name: http
      port: 80
      targetPort: 80
      protocol: TCP
  selector:
    app: nginx

---

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: nginx-ingress
  annotations:
    kubernetes.io/ingress.class: traefik
spec:
  rules:
  - host: nginx.example.com
    http:
      paths:
      - path: /
        backend:
          serviceName: nginxtest
          servicePort: http

我的 TOML 配置图如下所示:

apiVersion: v1
kind: ConfigMap
metadata:
  name: traefik-conf
  namespace: kube-system
data:
  traefik.toml: |
    defaultEntryPoints = ["http","https"]
    debug = false
    logLevel = "ERROR"
    #Config to redirect http to https
    [entryPoints]
      [entryPoints.http]
        address = ":80"
        compress = true
        [entryPoints.http.redirect]
        entryPoint = "https"
      [entryPoints.https]
        address = ":443"
        compress = true
        [entryPoints.https.tls]
    [api]
      [api.statistics]
        recentErrors = 10
    [kubernetes]
    [ping]
      entryPoint = "http"
    [accessLog]
    [acme]
      email = "a@b.com"
      storage = "certs/acme.json"
      acmeLogging = true
      entryPoint = "https"
      OnHostRule = true
      #caServer = "https://acme-staging-v02.api.letsencrypt.org/directory"
      [acme.httpChallenge]
        entryPoint="http"

任何帮助表示赞赏,请指出任何错误。

4

0 回答 0