{{- if .Values.ingress.enabled }} apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: {{ include "the-other-dude.fullname" . }} labels: {{- include "the-other-dude.labels" . | nindent 4 }} {{- with .Values.ingress.annotations }} annotations: {{- toYaml . | nindent 4 }} {{- end }} spec: {{- if .Values.ingress.className }} ingressClassName: {{ .Values.ingress.className }} {{- end }} {{- if .Values.ingress.tls.enabled }} tls: - hosts: - {{ .Values.ingress.host | default "the-other-dude.local" | quote }} secretName: {{ .Values.ingress.tls.secretName | default (printf "%s-tls" (include "the-other-dude.fullname" .)) | quote }} {{- end }} rules: - host: {{ .Values.ingress.host | default "the-other-dude.local" | quote }} http: paths: # API routes — send /api/* to the FastAPI service - path: /api pathType: Prefix backend: service: name: {{ include "the-other-dude.fullname" . }}-api port: number: {{ .Values.api.service.port }} # Docs routes — proxy /docs and /redoc to API as well - path: /docs pathType: Prefix backend: service: name: {{ include "the-other-dude.fullname" . }}-api port: number: {{ .Values.api.service.port }} - path: /redoc pathType: Prefix backend: service: name: {{ include "the-other-dude.fullname" . }}-api port: number: {{ .Values.api.service.port }} # Frontend SPA — all other routes go to nginx - path: / pathType: Prefix backend: service: name: {{ include "the-other-dude.fullname" . }}-frontend port: number: {{ .Values.frontend.service.port }} {{- end }}