I would like to use parameter passed in URL to route traffic to pods with specific labels. I can't tell in advance which values of app
will be used, so it must somehow dynamically create Ingres rules/Services:
Example:
https://foo.bar.com/?app=application1 --> route to service/pods with label: app=application1
https://foo.bar.com/?app=application2 --> route to service/pods with label: app=application2
https://foo.bar.com/?app=non-existing-app --> route to service/pods without any label app
.
I am wondering if it's possible using variables in path
and corresponding services, here is the idea and pseudo-code:
kind: Ingress
spec:
rules:
- host: foo.bar.com
http:
paths:
- path: /app=${APPLICATION}
backend:
serviceName: app-${APPLICATION}
servicePort: 8080