I have a Jenkins build process that deploys our code to several Kubernetes environments. Currently, it works fantastic with known/core branches (develop, release, master) and such, BUT we would like to make all of our feature branches and bug fix branches as well. In order to do this, we currently have it deploying an ingress with branch subdomains, like "{branchName}.domain.tld". The problem here is that there is a proliferation of ingresses and such for each branch.
I would LIKE to do something like "branch.domain.tld/{branchName}" and have the ingress dynamically route based on the "branchName" path. Unfortunately I only seem to get a single ingress per subdomain/host assignment (branch.domain.tld/bugfix_nasty doesn't route because branch.domain.tld/feat_cool already is defined).
What I would like to see is a single ingress that looks something like this:
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: dynamic_ingress
annotations:
{...stuff here}
spec:
rules:
- host: branch.domain.tld
http:
paths:
- path: /{branchName}/*
backend:
serviceName: {branchName}
servicePort: 80
Is there anyway to get to such a zenlike ingress?
All the stuff I see about this type of thing is advice on using regex for the path to capture and route to a known, defined service. I want this to route to variable service names.