I've been using GKE and setup GKE Ingress mere to manage the path for all images which we have kept in GCR.
I've created a .Net core based API which is has various path , if I expose the deployment with service as type Loadbalancer it works perfectly. Though when I utilize GKE Ingress and setup service and its backend it throws an error like Bad Gateway or sometime backend not found.
Hi Team,
I've been using GKE and setup GKE Ingress mere to manage the path for all images which we have kept in GCR. I've created a .Net core based API which is has various path , if I expose the deployment with service as type Loadbalancer it works perfectly. Though when I utilize GKE Ingress and setup service and its backend it throws an error like Bad Gateway or sometime backend not found.
.Net core api application exposes following path when i exposed on service as loadbalancer, kindly follow below screenshot for reference: http://35.202.38.40/api/books http://35.202.38.40/api/categories
The same way we do have post api's.
Now I'm stuck when I utilize GKE ingress and setup my ingress.yaml as follows , it doesn't work and throws an error. Ingress.Yaml
`apiVersion: networking.k8s.io/v1beta1 kind: Ingress metadata: name: gke-ingress annotations:
If the class annotation is not specified it defaults to "gce".
spec:
rules:
serviceName: hello-world servicePort: 80
backend:
serviceName: hello-world servicePort: 80 `
NOTE: my hello-word is exposing a .Net Core API application, kindly don't get confuse with name as "hello-world" for testing.
Deployment and service Yaml
`apiVersion: apps/v1 kind: Deployment metadata: name: hello-world-deployment spec: selector: matchLabels: greeting: hello department: world replicas: 2 template: metadata: labels: greeting: hello department: world spec: containers:
containerPort: 80
apiVersion: v1 kind: Service metadata: name: hello-world spec: type: NodePort selector: greeting: hello department: world ports:
Kindly advise how to setup path based routing in GKE Ingress for .Net Core Api app.