apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
  name: gateway
  namespace: gateway
spec:
  interval: 5m
  releaseName: gateway
  chartRef:
    kind: OCIRepository
    name: universal-helm-chart
    namespace: flux-system
  install:
    createNamespace: true
  values:
    httpRoute:
      enabled: true
      parentRefs:
        - name: external
          namespace: gateway-system
          sectionName: https
      hostnames:
        - "app.example.com"
    referenceGrant:
      enabled: true
      from:
        - group: gateway.networking.k8s.io
          kind: HTTPRoute
          namespace: gateway-system
      to:
        - group: ""
          kind: Service
    deployments:
      api:
        enabled: true
        replicaCount: 2
        image:
          repository: ghcr.io/example/api
          tag: v1.4.2
        service:
          enabled: true
          ports:
            http:
              port: 80
              targetPort: 8080
        httpRoute:
          enabled: true
          priority: 10
          rules:
            - matches:
                - path:
                    type: PathPrefix
                    value: /api
        resources:
          requests:
            cpu: 100m
            memory: 128Mi
          limits:
            memory: 256Mi
      web:
        enabled: true
        replicaCount: 2
        image:
          repository: nginx
          tag: "1.27"
        service:
          enabled: true
          ports:
            http:
              port: 80
              targetPort: 80
        httpRoute:
          enabled: true
          priority: 20
          rules:
            - matches:
                - path:
                    type: PathPrefix
                    value: /
        resources:
          requests:
            cpu: 50m
            memory: 64Mi
          limits:
            memory: 128Mi
