<p>We are trying to dockerize a set of webapps hosted on a JBoss Wildfly Server hosted in HA (Node 1 &amp; Node 2) configuration. There is an F5 load balancer server in front of the JBoss server performing sticky session based load balancing. So as far as F5 is concerned there is only one port (443) that it listens on and forwards the request to the JBoss Node 1 or Node 2. So, F5 did not need to have any information about the separate apps (for e.g. <a href="https://domain.name/app1" rel="nofollow noreferrer">https://domain.name/app1</a> &amp; <a href="https://domain.name/app2" rel="nofollow noreferrer">https://domain.name/app2</a>) hosted on the JBoss server.</p>

<p>Now we are dockerizing each webapp into its own container and wrapped as a Kubernettes pod. On the Kubernettes service layer each of the app (/app1 &amp; /app2) are hosted at separate ports. So each application gets its own port. </p>

<p>What load balancing architectural options do I have and could you point me at some relevant reading material?
1) Can F5 somehow consume metadata about which URL context path (/app1 or /app2) and route it to the appropriate port on the Kubernettes service layer?
2) If F5 cannot do any context path based routing on F5, then can some of this app-to-port routing be done via some Kuberneetes config?</p>

Vijay Tamhankar
<p>You may need an ingress controller for this. You can get detailed info about ingress controller over <a href="https://kubernetes.io/docs/concepts/services-networking/ingress/" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/services-networking/ingress/</a></p>

<p><a href="https://i.stack.imgur.com/aZZNc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aZZNc.png" alt="Typical Ingress looks like this"></a></p>

<p>Over the point of yours "On the Kubernetes service layer each of the app (/app1 &amp; /app2) are hosted at separate ports. So each application gets its own port."
Below Given example is for ingress controller considering your service name for app1 is app1-svc and for app2 is app2-svc</p>

<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: foo-https
  annotations:
    nginx.ingress.kubernetes.io/ssl-passthrough: "true"
    nginx.ingress.kubernetes.io/secure-backends: "true"
spec:
  tls:
   - hosts:
     - domain.name
  rules:
  - host: domain.name 
    http:
      paths:
      - path: /app1
        backend:
          serviceName: app1-svc
          servicePort: 443
      - path: /app2
        backend:
          serviceName: app2-svc
          servicePort: 443
</code></pre>
