I have a bare-metal kubernetes cluster with metal LB and ngnix and I'm able to access nginx on port 80 and see the welcome page. I applied an Ingress resource but yet I can't access my service although I'm able to access my service via the workers (on the nodeport specified). Is there anything I'm missing here?
Ingress:
apiVersion: networking.k8s.io/v1beta1 # for versions before 1.14 use extensions/v1beta1
kind: Ingress
metadata:
name: ingress
spec:
rules:
- http:
paths:
- path: /rest/endpoints/hello
backend:
serviceName: microservices-service
servicePort: 8085
- path: /rest/endpoints/calculateIterationTotalCapcity
backend:
serviceName: microservices-service
servicePort: 8085
Service:
apiVersion: v1
kind: Service
metadata:
name: microservices-service
spec:
selector:
app: microservices-deployment
ports:
- port: 8085
targetPort: 8085
nodePort: 30000
type: NodePort
Deployment:
apiVersion: apps/v1
kind: Deployment
metadata:
name: microservices-deployment
labels:
app: microservices-deployment
spec:
replicas: 3
template:
metadata:
name: microservices-deployment
labels:
app: microservices-deployment
spec:
containers:
- name: microservices-deployment
image: ** my image **
imagePullPolicy: Always
ports:
- containerPort: 8085
restartPolicy: Always
selector:
matchLabels:
app: microservices-deployment
UPDATE: I was able to trace the logs and I see these suspicious logs:
- - [30/Aug/2020:13:43:12 +0000] "GET /rest/endpoints/hello HTTP/1.1" 404 555 "-"**** "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.135 Safari/537.36" "-"
2020/08/30 13:43:12 [error] 28#28: *7 open() "/usr/share/nginx/html/rest/endpoints/hello" failed (2: No such file or directory), client:**** , server: localhost, request: "GET /rest/endpoints/hello HTTP/1.1", host: "****"