55 lines
1.6 KiB
YAML
55 lines
1.6 KiB
YAML
{{- if .Values.ingress.enabled -}}
|
|
apiVersion: networking.k8s.io/v1
|
|
kind: Ingress
|
|
metadata:
|
|
name: {{ include "timetracker.fullname" . }}
|
|
labels:
|
|
{{- include "timetracker.labels" . | nindent 4 }}
|
|
{{- with .Values.ingress.annotations }}
|
|
annotations:
|
|
{{- toYaml . | nindent 4 }}
|
|
{{- end }}
|
|
spec:
|
|
{{- if .Values.ingress.className }}
|
|
ingressClassName: {{ .Values.ingress.className }}
|
|
{{- end }}
|
|
rules:
|
|
{{- range .Values.ingress.hosts }}
|
|
- host: {{ .host | quote }}
|
|
http:
|
|
paths:
|
|
# Backend API routes first (more specific)
|
|
- path: /api
|
|
pathType: Prefix
|
|
backend:
|
|
service:
|
|
name: {{ include "timetracker.fullname" $ }}-backend
|
|
port:
|
|
number: {{ $.Values.backend.service.port }}
|
|
# Auth routes
|
|
- path: /auth
|
|
pathType: Prefix
|
|
backend:
|
|
service:
|
|
name: {{ include "timetracker.fullname" $ }}-backend
|
|
port:
|
|
number: {{ $.Values.backend.service.port }}
|
|
# Frontend (catch-all)
|
|
- path: /
|
|
pathType: Prefix
|
|
backend:
|
|
service:
|
|
name: {{ include "timetracker.fullname" $ }}-frontend
|
|
port:
|
|
number: {{ $.Values.frontend.service.port }}
|
|
{{- end }}
|
|
{{- if .Values.ingress.tls.enabled }}
|
|
tls:
|
|
- hosts:
|
|
{{- range .Values.ingress.hosts }}
|
|
- {{ .host | quote }}
|
|
{{- end }}
|
|
secretName: {{ .Values.ingress.tls.secretName }}
|
|
{{- end }}
|
|
{{- end }}
|