I recently started to learn about K8S and nginx deployment.
Followed a turorial where two applications (.NET and Angular) are deploy using LoadBalancer (both applications are accessible with their respective external IPs)then tutporial walks you thru nginx ingress configuration (yaml below)
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: webapp-ingress
namespace: app
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/ssl-redirect: "false"
nginx.ingress.kubernetes.io/use-regex: "true"
nginx.ingress.kubernetes.io/rewrite-target: /$1
spec:
rules:
- http:
paths:
- backend:
serviceName: webapp1-svc
servicePort: 80
path: /webapp1(/|$)(.*)
- backend:
serviceName: webapp2-svc
servicePort: 80
path: /webapp2(/|$)(.*)
- host: frontend.14.97.47.100.nip.io # change the IP address here
http:
paths:
- backend:
serviceName: webapp1-svc
servicePort: 80
path: /webapp1 //this is an angular app-does not work
- backend:
serviceName: webapp2-svc
servicePort: 80
path: /webapp2 //ASP app-opens fine
pointing browser to “http://frontend.14.97.47.100.nip.io/webapp1” does not produce any errors but the page is not displayed either.
is this due to the angular application? if so why does it work if configured as LoadBalancer?
Any direction is greatly appreciated.