添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
爽快的镜子  ·  Troubleshooting: Use ...·  4 月前    · 
追风的花生  ·  Rewrite - ...·  1 年前    · 
刀枪不入的马铃薯  ·  NGINX Ingress ...·  1 年前    · 
沉稳的咖啡豆  ·  Docker & Kubernetes : ...·  1 年前    · 
越狱的刺猬  ·  Annotations - ...·  1 年前    · 
重感情的小熊猫  ·  BA (Hons) Computer ...·  3 周前    · 
俊秀的葫芦  ·  ROG 幻14-ACRNM 限定版·  2 月前    · 
严肃的石榴  ·  DOMException: Blocked ...·  2 月前    · 
1.1.3 Blog Knowledge Base

Troubleshooting: Use Traefik 2.x as ingress controller

| April 20, 2021

Applicable versions

All Longhorn versions with Traefik 2.x as ingress controller.

Note that, the CORS problem would not happen with Traefik 1.x as ingress controller.

Symptoms

The Longhorn GUI frontend API requests sometimes failed to reach longhorn-manager backend.

Reason

The API requests would change the protocol between HTTPS/WSS, and the change would lead to a CORS problem.

Solution

The Traefik 2.x ingress controller does not set the WebSocket headers.

  1. Adds the following middleware to the route for the Longhorn frontend service.

    apiVersion: traefik.containo.us/v1alpha1
    kind: Middleware
    metadata:
      name: svc-longhorn-headers
      namespace: longhorn-system
    spec:
      headers:
        customRequestHeaders:
          X-Forwarded-Proto: "https"
    
  2. Updates the ingress to use the middleware rule.

    apiVersion: networking.k8s.io/v1beta1
    kind: Ingress
    metadata:
      name: longhorn-ingress
      namespace: longhorn-system
      annotations:
        traefik.ingress.kubernetes.io/router.entrypoints: websecure
        traefik.ingress.kubernetes.io/router.tls: "true"       
        traefik.ingress.kubernetes.io/router.middlewares: longhorn-system-svc-longhorn-headers@kubernetescrd
    spec:
      rules:
      - http:
          paths:
          - path: /