I'm trying to connect my web service using ingress on bare metal kubernetes with metallb. Since I'm trying to service at least to different service, but I only have one possible ip address. I set rules for ingress as follows:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ad-ingress-service3
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /$2
nginx.ingress.kubernets.io/app-root: /root/team_AD/leejh/ui/
# nginx.ingress.kubernetes.io/enable-rewrite-log: "true"
spec:
rules:
- host: "team.ads"
http:
paths:
- path: /wine(/|$)(.*)
pathType: Prefix
backend:
service:
name: ui-svc2
port:
number: 100
I can see my index.html page, but my index.js which is in the same directory with index.html, is not. On chrome console, I got 404 error, saying http://team.ads/index.js not found. What should I do?
I'm expecting when I type http://team.ads/wine in the address bar, I can get my first webpage. But .js and .css files are not found.