apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: tb-http-loadbalancer
  namespace: thingsboard
  annotations:
    kubernetes.io/ingress.class: alb
    alb.ingress.kubernetes.io/scheme: internet-facing
    alb.ingress.kubernetes.io/target-type: ip
    # Don't forget to replace YOUR_CERTIFICATE_ARN with the correct value
    # See https://docs.aws.amazon.com/elasticloadbalancing/latest/application/create-https-listener.html#https-listener-certificates for more info
    alb.ingress.kubernetes.io/certificate-arn: YOUR_HTTPS_CERTIFICATE_ARN
    alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}, {"HTTPS": 443}]'
    alb.ingress.kubernetes.io/ssl-redirect: '443'
spec:
  rules:
    - http:
        paths:
          - path: /api/v1/integrations/*
            pathType: ImplementationSpecific
            backend:
              service:
                name: tb-node
                port:
                  number: 8080
          - path: /api/v1/*
            pathType: ImplementationSpecific
            backend:
              service:
                name: tb-http-transport
                port:
                  number: 8080
          - path: /static/rulenode/*
            pathType: ImplementationSpecific
            backend:
              service:
                name: tb-node
                port:
                  number: 8080
          - path: /static/*
            pathType: ImplementationSpecific
            backend:
              service:
                name: tb-web-ui
                port:
                  number: 8080
          - path: /index.html
            pathType: ImplementationSpecific
            backend:
              service:
                name: tb-web-ui
                port:
                  number: 8080
          - path: /*
            pathType: ImplementationSpecific
            backend:
              service:
                name: tb-node
                port:
                  number: 8080
