---
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: frontend-applications-ingress
  namespace: zjejpt-uas
  labels:
    type: frontend
    octopus.control: all-ingress-config-wdd
    app.kubernetes.io/managed-by: octopus-control
    app.kubernetes.io/version: uas-2.1
  annotations:
    kubernetes.io/ingress.class: "nginx"
    nginx.ingress.kubernetes.io/enable-cors: "true"
    nginx.ingress.kubernetes.io/rewrite-target: /$1
    nginx.ingress.kubernetes.io/configuration-snippet: |
      rewrite ^(/uas)$ $1/ redirect;
      rewrite ^(/uasms)$ $1/ redirect;
spec:
  rules:
    - host: fake-domain.zjejpt-uas.io
      http:
        paths:
          - path: /uas/?(.*)
            pathType: ImplementationSpecific
            backend:
              serviceName: cmii-uav-platform-uas
              servicePort: 9528
          - path: /uasms/?(.*)
            pathType: ImplementationSpecific
            backend:
              serviceName: cmii-uav-platform-uasms
              servicePort: 9528
---
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: all-gateways-ingress
  namespace: zjejpt-uas
  labels:
    type: api-gateway
    octopus.control: all-ingress-config-1.1.0
    app.kubernetes.io/managed-by: octopus-control
    app.kubernetes.io/version: uas-2.1
  annotations:
    kubernetes.io/ingress.class: "nginx"
    nginx.ingress.kubernetes.io/enable-cors: "true"
    nginx.ingress.kubernetes.io/rewrite-target: /$1
    nginx.ingress.kubernetes.io/configuration-snippet: |
      proxy_set_header upgradePrefix $http_upgrade;
      proxy_set_header Connection "upgradePrefix";
spec:
  rules:
    - host: fake-domain.zjejpt-uas.io
      http:
        paths:
          - path: /uas/api/?(.*)
            pathType: ImplementationSpecific
            backend:
              serviceName: cmii-uas-gateway
              servicePort: 8080
          - path: /converge/?(.*)
            pathType: ImplementationSpecific
            backend:
              serviceName: cmii-sky-converge
              servicePort: 8080
