Reputation: 317
I'm not sure if I ask this question here, but I need some clarification I have a Kubernetes cluster and I am wondering since the frontend runs on the client's web browser. Am I able to only expose the API internally and still make HTTP requests to it from the client or am I only able to expose the service using the node port, ingress, and load balancer which exposes it to the internet?
Thanks in advance for the feedback
Upvotes: 1
Views: 1512
Reputation: 264
You can expose it to the frontend via an ingress and also (at the same time) internally for other services/pods/containers you have running inside the cluster, it all depends on how you configure it.
Assuming you only want it to run internally, all you have to do is not create an ingress. If you want to expose it, then do create the ingress. In both cases you should always create the 'service' as that's what exposes your pods's code to the cluster (inside and outside via ingress).
Service: https://kubernetes.io/docs/concepts/services-networking/service/
Ingress: https://kubernetes.io/docs/concepts/services-networking/ingress/
Hope that clarifies it!
Upvotes: 1