我的网站没有使用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"
感谢您的帮助,请指出任何错误。