I want to use my hostname as test.com in first namespace and example.com/demo in another namespace. However i am unable to do that since (in my opinion) the nginx-ingress controller always points to the first website (example.com). My nginx-ingress controller is running in the default namespace
#namespace prod
kind: Ingress
apiVersion: extensions/v1beta1
metadata:
name: ingress
namespace: production
annotations:
nginx.ingress.kubernetes.io/proxy-body-size: 20m
spec:
rules:
- host: example.com
http:
paths:
- path: /static
backend:
serviceName: app-svc
servicePort: 80
- path: /
backend:
serviceName: app-svc
servicePort: 8000
tls:
- hosts:
- example.com
secretName: cert
status:
loadBalancer:
ingress:
- ip: xx.xxx.xx.xxx
#namespace dev
kind: Ingress
apiVersion: extensions/v1beta1
metadata:
name: test-ingress
namespace: dev-env
annotations:
nginx.ingress.kubernetes.io/proxy-body-size: 20m
spec:
rules:
- host: example.com
http:
paths:
- path: /static
backend:
serviceName: app-svc
servicePort: 80
- path: /demo
backend:
serviceName: app-svc
servicePort: 8000
tls:
- hosts:
- example.com
secretName: cert
status:
loadBalancer:
ingress:
- ip: xx.xxx.xx.xxx