Routes /api, /docs, /metrics to API service and / to frontend, with optional TLS and annotation support. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
55 lines
1.5 KiB
YAML
55 lines
1.5 KiB
YAML
{{- if .Values.ingress.enabled }}
|
|
apiVersion: networking.k8s.io/v1
|
|
kind: Ingress
|
|
metadata:
|
|
name: {{ include "tod.fullname" . }}
|
|
labels:
|
|
{{- include "tod.labels" . | nindent 4 }}
|
|
{{- with .Values.ingress.annotations }}
|
|
annotations:
|
|
{{- toYaml . | nindent 4 }}
|
|
{{- end }}
|
|
spec:
|
|
ingressClassName: {{ .Values.ingress.className }}
|
|
{{- if .Values.ingress.tls.enabled }}
|
|
tls:
|
|
- hosts:
|
|
- {{ .Values.ingress.host }}
|
|
{{- if .Values.ingress.tls.secretName }}
|
|
secretName: {{ .Values.ingress.tls.secretName }}
|
|
{{- end }}
|
|
{{- end }}
|
|
rules:
|
|
- host: {{ .Values.ingress.host }}
|
|
http:
|
|
paths:
|
|
- path: /api
|
|
pathType: Prefix
|
|
backend:
|
|
service:
|
|
name: {{ include "tod.fullname" . }}-api
|
|
port:
|
|
number: 8000
|
|
- path: /docs
|
|
pathType: Prefix
|
|
backend:
|
|
service:
|
|
name: {{ include "tod.fullname" . }}-api
|
|
port:
|
|
number: 8000
|
|
- path: /metrics
|
|
pathType: Exact
|
|
backend:
|
|
service:
|
|
name: {{ include "tod.fullname" . }}-api
|
|
port:
|
|
number: 8000
|
|
- path: /
|
|
pathType: Prefix
|
|
backend:
|
|
service:
|
|
name: {{ include "tod.fullname" . }}-frontend
|
|
port:
|
|
number: 80
|
|
{{- end }}
|