Kubernetes Ingress + Apache气流 [英] Kubernetes Ingress + Apache airflow
问题描述
你能帮我吗?
我正在尝试在vpc中的Kubernetes(AWS)中启动Apache airflow. 我正在使用头盔稳定/气流7.1.1
I'm trying to start Apache airflow in Kubernetes (AWS), in vpc. I'm using helm stable/airflow 7.1.1
一切正常.但是要访问Web界面,我需要通过入口ELB公开它. 我有这个设置. 气流规则如下所示:
Everything starts ok. But to get access to web interface I need to expose it via ingress ELB. I have this setup. The rule for airflow looks like this:
apiVersion: v1
items:
- apiVersion: extensions/v1beta1
kind: Ingress
metadata:
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/connection-proxy-header: upgrade
nginx.ingress.kubernetes.io/rewrite-target: /$2
creationTimestamp: "2020-05-29T14:52:54Z"
generation: 31
labels:
app.kubernetes.io/instance: airflow-dev-web
app.kubernetes.io/managed-by: Tiller
app.kubernetes.io/name: airflow-dev-web
app.kubernetes.io/version: "1.0"
helm.sh/chart: web-service-0.1.0
name: airflow
namespace: dev
resourceVersion: "45272238"
selfLink: /apis/extensions/v1beta1/namespaces/dev/ingresses/airflow
uid: 64f276ad-b51f-4551-8078-51a7184b04b4
spec:
rules:
- host: public.host.com
http:
paths:
- backend:
serviceName: airflow-dev-web
servicePort: 8080
path: /airflow(/|$)(.*)
status:
loadBalancer:
ingress:
- ip: <public_ip>
我可以用/health打开/health:
I can open the /health with is OK:
https://public.host.com/airflow/health
但是当我打开管理Web端点时:
But when I open admin web endpoint:
https://public.host.com/airflow/admin
我有许多未重写的url-它们指向的是public.host.com,而不是public.host.com/airflow/....就像这样:
I have many not rewritten urls - they are pointing to public.host.com but not to public.host.com/airflow/ .... Like this:
URL: https://public.host.com/admin/admin/bootstrap/bootstrap3/css/bootstrap-theme.min.css?v=3.3.5
Status: 404 Not Found
我发现我需要对反向代理进行特殊设置.像这里:
I found that I need special setup for reverse proxy.. Like here:
https://airflow.readthedocs.io/en /stable/howto/run-behind-proxy.html
但是我找不到如何使用Ingress ....:((
But I cannot find how to do this using Ingress.... :((
请帮助我!
推荐答案
不再是实际的. 使用以下方法赢得了它:
Is not actual anymore. Have won it using:
nginx.ingress.kubernetes.io/server-snippet: |
proxy_set_header Host $host;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
还需要设置气流:
ENABLE_PROXY_FIX: "True"
和
baseUrl: "http://local.airflow/airflow"
这篇关于Kubernetes Ingress + Apache气流的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!