Airflow Web服务的Istio虚拟服务问题

时间:2020-05-13 12:19:26

标签: kubernetes airflow istio

我正在尝试为Airflow Webservice设置istio 我当前的气流网址是http://myorg.com:8080/appv1/airflow(无istio)

在我尝试与istio集成后,我按如下所示编写了虚拟服务,但最终却得到404 Not Found。我正在尝试从http://myorg.com/v1airlfow

访问URL
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: airflow-vservice
  namespace: "{{ .Release.Namespace }}"
spec:
  hosts:
  - "*"
  gateways:
  - airflow-gateway
  http:
  - name: airflow-http
    match:
    - uri:
        exact: "/v1airflow"
    - uri:
        exact: "/v1airflow/"
    rewrite:            
      uri: "/appv1/airflow/"
    route:
    - destination:
        host: {{ .Release.Name }}-airflow-web.{{ .Release.Namespace }}.svc.cluster.local
        port:
          number: 8080
    headers:
      request:
        set:
          X-Forwarded-Proto: "http"
---
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
  name: airflow-gateway
  namespace: "{{ .Release.Namespace }}"
spec:
  selector:
    istio: ingressgateway
  servers:
  - port:
      number: 80
      name: airflow-http
      protocol: HTTP
    hosts:
    - "*"

1 个答案:

答案 0 :(得分:1)

  • uri: 前缀:“ / v1airflow”
    • uri: 前缀:“ / v1airflow / home”
    • uri: 前缀:“ / v1airflow / static”
    • uri: 前缀:“ / v1airflow / login”
    • 重写: 正则表达式:^ / v1airflow /(.*)$

让它正常工作