Deploy REST API as clusterIP and web app as NodePort

5/25/2019

My REST API is deployed a clusterIP. Web app consuming REST API is deployed as NodePort. Both are on the same cluster. When I run my web app the connection to the REST API (ClusterIP) fails.

-- abi
google-kubernetes-engine
kubernetes

1 Answer

5/25/2019

ClusterIP is a virtual IP so it will not be resolved from outside your cluster. Your web app will be used in browser so it will need a public URL for the restapi. You can create restapi also a node port service or you can add ingress service in your cluster and then use routing based on the hostpath.

-- Aman Juneja
Source: StackOverflow