feat(helm): add Ingress template with API, docs, metrics, and frontend routes
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>
This commit is contained in:
54
infrastructure/helm/templates/ingress.yaml
Normal file
54
infrastructure/helm/templates/ingress.yaml
Normal file
@@ -0,0 +1,54 @@
|
||||
{{- 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 }}
|
||||
Reference in New Issue
Block a user