47 lines
1.4 KiB
YAML
47 lines
1.4 KiB
YAML
|
|
# ============================================================
|
|||
|
|
# Система: Единая библиотека, Центр ИИ НИУ ВШЭ
|
|||
|
|
# Модуль: APIComponent
|
|||
|
|
# Авторы: Полежаев В.А., Хританков А.С.
|
|||
|
|
# Дата создания: 2025 г.
|
|||
|
|
# ============================================================
|
|||
|
|
apiVersion: networking.k8s.io/v1
|
|||
|
|
kind: Ingress
|
|||
|
|
metadata:
|
|||
|
|
name: {{ name }}
|
|||
|
|
namespace: {{ namespace }}
|
|||
|
|
{% if cors %}
|
|||
|
|
annotations:
|
|||
|
|
nginx.ingress.kubernetes.io/enable-cors: "true"
|
|||
|
|
{% if cors.allow_methods %}
|
|||
|
|
nginx.ingress.kubernetes.io/cors-allow-methods: {{ cors.allow_methods }}
|
|||
|
|
{% endif %}
|
|||
|
|
{% if cors.allow_headers %}
|
|||
|
|
nginx.ingress.kubernetes.io/cors-allow-headers: {{ cors.allow_headers }}
|
|||
|
|
{% endif %}
|
|||
|
|
{% if cors.expose_headers %}
|
|||
|
|
nginx.ingress.kubernetes.io/cors-expose-headers: {{ cors.expose_headers }}
|
|||
|
|
{% endif %}
|
|||
|
|
{% if cors.allow_origin %}
|
|||
|
|
nginx.ingress.kubernetes.io/cors-allow-origin: {{ cors.allow_origin }}
|
|||
|
|
{% endif %}
|
|||
|
|
{% if cors.max_age %}
|
|||
|
|
nginx.ingress.kubernetes.io/cors-max-age: "{{ cors.max_age }}"
|
|||
|
|
{% endif %}
|
|||
|
|
{% endif %}
|
|||
|
|
spec:
|
|||
|
|
ingressClassName: nginx
|
|||
|
|
tls:
|
|||
|
|
- hosts:
|
|||
|
|
- {{ domain }}
|
|||
|
|
rules:
|
|||
|
|
- host: {{ domain }}
|
|||
|
|
http:
|
|||
|
|
paths:
|
|||
|
|
- path: {{ path }}
|
|||
|
|
pathType: ImplementationSpecific
|
|||
|
|
backend:
|
|||
|
|
service:
|
|||
|
|
name: {{ service_name }}
|
|||
|
|
port:
|
|||
|
|
number: {{ service_port }}
|