简体   繁体   English

如何为 kube.netes 中的特定 traefik 入口禁用 tls?

[英]How to disable tls for specific traefik ingress in kubernetes?

I am using traefik ingress controller in Kube.netes.我在 Kube.netes 中使用 traefik ingress controller。 It is configured to redirect all request to https and terminate tls connection before passing the request to backend service.它被配置为将所有请求重定向到 https 并在将请求传递给后端服务之前终止 tls 连接。

Is it possible to only enable http for one particular ingress config but https for other ingresses?是否可以只为一个特定的入口配置启用 http 而为其他入口配置启用 https? Any example would be helpful.任何例子都会有所帮助。

I only want to enable http(no https) for this ingress我只想为此入口启用 http(无 https)

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: test-ingress
spec:
  rules:
  - host: testdomain.com
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: test-service
            port:
              number: 8080

You can create the one ingress with the config like您可以使用如下配置创建一个入口

apiVersion: networking.k8s.io/v1
kind: Ingress
annotation:
  kubernetes.io/ingress.class: "traefik"
  ingress.kubernetes.io/force-ssl-redirect: "false"  
  ingress.kubernetes.io/ssl-redirect: "false"
  traefik.ingress.kubernetes.io/frontend-entry-points: http
metadata:
  name: test-ingress
spec:
  rules:
  - host: testdomain.com
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: test-service
            port:
              number: 8080

you can get more idea about the annotation from here: https://doc.traefik.io/traefik/v1.6/configuration/backends/kube.netes/您可以从这里获得有关注释的更多信息: https://doc.traefik.io/traefik/v1.6/configuration/backends/kube.netes/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM