Hi i have a question when it comes to k8s and handling branches
my namespaces have the following :
NodePort
service mapping the port 3000
of the deployment to port 80
postgres
instance to serve as a DB (Not important for this problem)Ingress
exposing allI would like to find a way that would make it able to :
I'm not able to find any documentation helping, I've tried a lot of things so far but cannot make it work
Here's a repo to see what I have so far : https://github.com/girards/tracks
Thanks in advance
You could deploy an ingress controller such as nginx and create ingress resource to expose backend services using host
.
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: simple-ingress-example
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /
spec:
rules:
- host: api.branchname.domain.com
http:
paths:
- path: /
backend:
serviceName: servicename
servicePort: 3000