traefik增加https支持

  sre
#在每个node上执行
mkdir -p /etc/kubernetes/ssl
cd /etc/kubernetes/ssl
#上传证书

变更ConfigMap:

kind: ConfigMap
apiVersion: v1
metadata:
  name: traefik-conf
  namespace: kube-system
data:
  traefik.toml: |
    insecureSkipVerify = true
    defaultEntryPoints = ["http","https"]
    [entryPoints]
      [entryPoints.http]
      address = ":80"
      [entryPoints.https]
      address = ":443"
        [entryPoints.https.tls]
          [[entryPoints.https.tls.certificates]]
          CertFile = "/ssl/tls.crt"
          KeyFile = "/ssl/tls.key"
          [[entryPoints.https.tls.certificates]]
          CertFile = "/etc/kubernetes/ssl/ktest.pem"
          KeyFile = "/etc/kubernetes/ssl/ktest.key"

重启treafik控制器即可。

LEAVE A COMMENT

Captcha Code