apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: {{ include "backstage.fullname" . }}-ingress
  {{- with .Values.ingress.annotations }}
  annotations:
  {{- toYaml . | nindent 4 }}
  {{- end }}
spec:
  rules:
    - host: {{ .Values.appConfig.app.baseUrl | trimPrefix "https://" | trimSuffix "/" }}
      http:
        paths:
          - path: /
            backend:
              serviceName: {{ include "frontend.serviceName" . }}
              servicePort: 80
    - host: {{ .Values.appConfig.backend.baseUrl | trimPrefix "https://" | trimSuffix "/" }}
      http:
        paths:
          - path: /api
            backend:
              serviceName: {{ include "backend.serviceName" . }}
              servicePort: 80
    - host: {{ .Values.appConfig.lighthouse.baseUrl | trimPrefix "https://" | trimSuffix "/" }}
      http:
        paths:
          - path: /
            backend:
              serviceName: {{ include "lighthouse.serviceName" . }}
              servicePort: 80

