问题
Can you please help me?
I'm trying to start Apache airflow in Kubernetes (AWS), in vpc. I'm using helm stable/airflow 7.1.1
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>
I can open the /health with is OK:
https://public.host.com/airflow/health
But when I open admin web endpoint:
https://public.host.com/airflow/admin
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
But I cannot find how to do this using Ingress.... :((
Please help me!
回答1:
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";
Also it will be needed to setup in airflow:
ENABLE_PROXY_FIX: "True"
and
baseUrl: "http://local.airflow/airflow"
来源:https://stackoverflow.com/questions/62102533/kubernetes-ingress-apache-airflow