【问题标题】:Istio virtualservice issue for Airflow webserviceAirflow 网络服务的 Istio 虚拟服务问题
【发布时间】:2020-05-19 02:07:20
【问题描述】:

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

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

---
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:
    - "*"

【问题讨论】:

  • 您好,您使用的是什么平台?您使用哪些 k8s 和 istio 版本?
  • @PiotrMalec - 我使用 istio 1.5.0 和 k8s 1.16.7

标签: kubernetes airflow istio


【解决方案1】:
  • uri: 前缀:“/v1airflow”
    • uri: 前缀:“/v1airflow/home”
    • uri: 前缀:“/v1airflow/static”
    • uri: 前缀:“/v1airflow/login”
    • 重写: 正则表达式:^/v1airflow/(.*)$

搞定了

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-08-12
    • 2021-06-09
    • 2021-09-21
    • 1970-01-01
    • 2021-12-12
    • 2012-12-20
    • 2019-07-19
    相关资源
    最近更新 更多