I'm setting a bare-metal kubernetes cluster for a web application in a google cloud instance, I am connecting to microservices through an ingress controller. How do I access the ingress controller from all incoming hosts?
There is a pod running angular web application and another pod running a node api microservice. Angular Web Application has been exposed globally. When accessing the microservice externally and passing the header with the hostname I was able to get the expected response. On removing the host in the ingress yaml I am not able to access the ingress.
kind: Ingress
metadata:
annotations:
ingress.kubernetes.io/rewrite-target: nginx
creationTimestamp: "2019-08-12T07:41:37Z"
generation: 7
name: test
namespace: default
resourceVersion: "546400"
selfLink: /apis/extensions/v1beta1/namespaces/default/ingresses/test
uid: 374836d2-34c3-4053-b0e3-9fe3f63167cc
spec:
rules:
- host: bar.com
http:
paths:
- backend:
serviceName: login-service
servicePort: 3000
path: /login-service
- backend:
serviceName: organization-service
servicePort: 3000
path: /organization-service
status:
loadBalancer:
ingress:
- ip: 10.128.0.16
- ip: 203.0.113.2
I except the ingress to be accessed from all the hosts other than the specified host(bar.com) in ingress.
Any other way to access the API microservice from the outside cluster(globally)?