Files
python-oauth2-proxy-k8s/k8s/ingress.yaml
2025-10-01 15:04:07 +05:00

42 lines
1.4 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Единый Ingress с аутентификацией для всего приложения
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: python-navigator-demo
namespace: python-navigator-demo
annotations:
nginx.ingress.kubernetes.io/auth-signin: https://$host/dex-authenticator/sign_in
nginx.ingress.kubernetes.io/auth-url: https://python-navigator-demo-auth-dex-authenticator.python-navigator-demo.svc.cluster.local/dex-authenticator/auth
nginx.ingress.kubernetes.io/auth-response-headers: X-Auth-Request-User,X-Auth-Request-Email,Authorization
nginx.ingress.kubernetes.io/configuration-snippet: |
proxy_set_header X-Auth-Request-User $http_x_auth_request_user;
proxy_set_header X-Auth-Request-Email $http_x_auth_request_email;
proxy_set_header Authorization $http_authorization;
spec:
ingressClassName: nginx
tls:
- hosts:
- python-navigator-demo.127.0.0.1.sslip.io
secretName: python-navigator-demo-tls
rules:
- host: python-navigator-demo.127.0.0.1.sslip.io
http:
paths:
# API запросы идут напрямую в backend
- path: /api
pathType: Prefix
backend:
service:
name: backend
port:
number: 8000
# Все остальное идет в frontend
- path: /
pathType: Prefix
backend:
service:
name: frontend
port:
number: 80