Reputation: 33
I have k8s custer in digital ocean.
I would like to expose some app to internet.
Do I need for every app DO loadbalancer? It coast 10$/m it F* expensive when I would like to expose 5 aps.
Is there any workaround without external DO loadbalancer?
Upvotes: 0
Views: 114
Reputation: 1847
You can use an ingress to expose several services.
This way only the ingress controller needs to be exposed as LoadBalancer, and it can reverse-proxy requests towards the services you want exposed. You can keep the other services as ClusterIP.
Check the docs for more details.
Note that in addition to applying the ingress resource (with the paths, etc, to the services you want exposed), you'll need to deploy an ingress controller. ingress-nginx is a common choice.
Upvotes: 1
Reputation: 54191
Copying this from the last time someone asked this a few days ago (which has now been delete):
You can use a node port service (annoying because you'll have to use random high ports instead of 80/443) or you can switch your ingress controller to listen on the host network directly (allows use of 80/443 but potentially bigger security impact if your ingress controller is compromised).
Upvotes: 1