Exposing several services with Vagrant and Kubernetes on my own server

376 Views Asked by At

Assume the following stack:

  • A dedicated server
  • The server is running Vagrant
  • Vagrant is running 2 virtual machines master + minion-1 (Kubernetes)
  • minion-1 is running a pod
  • Within the pod is 2 containers: webservice and fileservice

Both webservice and fileservice should be accessible from internet i.e. from outside. Either by web.mydomain.com - file.mydomain.com or www.mydomain.com/web/ - www.mydomain.com/file/

Before using Kubernetes, I was using a remote proxy (HAproxy) and simply mapped domain names to an internal ip / port.

Now with Kubernetes, I can imagine there is something dedicated to this task but I honestly have no clue from where to start.

I read about "createExternalLoadBalancer", kubernetes Services and kube-proxy. Should a reverse-proxy still be put somewhere (before vagrant or within a pod ?) also is using Vagrant a good option for production (staying in the scope of this question) ?

1

There are 1 best solutions below

0
On

The easiest thing for you to do at the moment is to make a service of type "nodePort", and to configure your HAproxy to point at minion-1:.

createExternalLoadBalancer is the old, less flexible, way to do this--it requires the cloud provider to do work. Type=nodePort doesn't require anything special from the cloud provider.