Q:

How to define some Kubernetes Ingress routes with specific ports

I'm trying to create some ingress rules for my Kubernetes cluster (currently, on localhost using Docker Desktop) and they are not working.
What I'm trying to do
- App #1 : Some database (e.g. mongodb or RavenDb or Postgres, etc).
- App #2 : Some queue (rabbitmq, etc)
- App #3 : Some web site api #1 
- App #4 : Some web site api #2

Routes to access each app
- App #1 : <anything>:port 5200
- App #2 : <anything>:port 5300
- App #3 : /account/*:80, /accounts:80
- App #4 : /order/*:80, /orders/*:80

[note -> i'm not including ssl/443 port yet because i've not handled that, etc]
So here's an example what I've got for the first app (which doesn't work):
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: data-ravendb-ingress
  annotations:
    kubernetes.io/ingress.class: traefik
spec:
  rules:
  - http:
      paths:
      - backend:
          serviceName: data-ravendb-service
          servicePort: dashboard

---
apiVersion: v1
kind: Service
metadata:
  name: data-ravendb-service
  labels:
    app: hornet
    tier: backend
    component: data-ravendb
spec:
  ports:
  - name: dashboard
    port: 5200
    targetPort: 8080
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: data-ravendb-deployment
spec:
  replicas: 1
  template:
    metadata:
      labels:
        app: hornet
        tier: backend
        component: data-ravendb
    spec:
      containers:
      - name: data-ravendb-container
        image: ravendb/ravendb
        imagePullPolicy: Always
        ports:
        - containerPort: 8080
          name: dashboard

How can I setup my ingress to allow those 4 Apps to access the backend services appropriately?

A:

That's currently not fully supported to route in Kubernetes Ingress any other traffic than HTTP/HTTPS protocols. Also Traefik which you use is HTTP reverse proxy so it will be either hard or not possible to do that using that ingress controller.
See Kubernetes: Routing non HTTP Request via Ingress to Container 

