I am attempting to have the ingress-nginx controller route requests to certain namespace based on the suffix of the URL. For instance .com/namespace1 would point users to namespace1 in a GKE cluster.
I have ingress enabled in my Z2JH Helm chart.
ingress:
enabled: true
hosts:
- "<NAME>.com"
pathSuffix:
"${class-section}"
annotations:
kubernetes.io/ingress.class: "nginx"
The pathSuffix is currently just passing in a substitution variable in Terraform but seems to be working properly, this is used within a for_each type loop so that each ingress object has it’s own unique pathSuffix that relates to the namespace that the ingress is in.
Running kubectl describe ingress -n namespace1
gives the output of
Rules:
Host Path Backends
---- ---- --------
<NAME>.com
/namespace1 proxy-public:80 (11.1.1.29:8000)
Annotations: kubernetes.io/ingress.class: nginx
meta.helm.sh/release-name: jupyterhub
meta.helm.sh/release-namespace: namespace1
Then running kubectl describe ingress -n namespace2
Rules:
Host Path Backends
---- ---- --------
<NAME>.com
/namespace2 proxy-public:80 (11.1.1.30:8000)
Annotations: kubernetes.io/ingress.class: nginx
meta.helm.sh/release-name: jupyterhub
meta.helm.sh/release-namespace: namespace2
If I attempt to access .com or .com/namespace1 I get a 404 Not Found nginx
.
If I do not use a pathSuffix input then I am able to access just .com
I am not sure what else I am missing.
Edit: I do have the proxy service set as a type of ClusterIP.
proxy:
secretToken:
service:
type: ClusterIP
Does this need to be a NodePort?