apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: chatapp-ingress
  namespace: chatapp
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /
    nginx.ingress.kubernetes.io/websocket: "true"
spec:
  ingressClassName: nginx
  rules:
  - host: api.chatapp.com
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: api
            port:
              number: 3010
  - host: ws.chatapp.com
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: websocket
            port:
              number: 3002
  - host: app.chatapp.com
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: web
            port:
              number: 3001