I want to create an nginx load balancer in kubernetes.
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ecom-ingress
spec:
defaultBackend:
service:
name: ecom-ui-service
port:
number: 80
rules:
- http:
paths:
- path: /identity
pathType: ImplementationSpecific
backend:
service:
name: ecom-identity-service
port:
number: 80
- path: /catalog
pathType: ImplementationSpecific
backend:
service:
name: ecom-catalog-service
port:
number: 80
So I have created services and pods on cluster. And now I want to create an ingress to access my servies using rewrite.
When I send this nginx yml file using kubectl command "kubectl apply -f ingress.yml" it creates a gce load balancer in ingress tab of google page like following. And I can not access the catalog endpoint. It returns nginx 404 page.
if I use following helm command in google management page console, it creates a loadbalancer in services tab.
helm install nginx-ingress nginx-stable/nginx-ingress --set rbac.create=true
So I want to create an nginx loadbalancer in services tab or I want to use rewrite rules in gce loadbalancers.
How can I specify my ingress yml file for this purpose? And I want to use the rewrite for use my services to use query strings etc.
In this link one of the use case is rewrite request URI before sending it to application.
There is also information about yaml deployment in ingress and in service that you can use as a guidance in your deployment.