3

According to Traefik's Kubernetes guide, I should use a Service of type NodePort to expose Traefik (YAML file here). However, if I do that, how do I expose one of the IPs from my cluster to the outside world?

At this moment, I have edited the example traefik-deployment.yaml file to be a LoadBalancer instead, and it seems to work just fine with the IP that the load balancer provides. What am I missing?

ivarec
  • 2,542
  • 2
  • 34
  • 57
  • 5
    Traefik recommends NodePort because it's available on every k8s setup (cloud/bare-metal). LoadBalancer are provided by a cloud provider. It is usually better to use a LoadBalancer rather than a NodePort. – nouney Jan 28 '18 at 00:30
  • This looks like to be the correct answer, but it is a comment :) – ivarec Jan 28 '18 at 00:45

1 Answers1

3

Both are valid approaches. The Kubernetes guide basically makes one proposal to set things up (with somewhat of a focus on the local minikube configuration). If you have found a path that's more convenient for you, by all means feel free to stick to it.

FWIW, one concern I sometimes hear raised is that cloud-based LoadBalancers may become expensive much faster, whereas with a NodePort you have more control over how requests are routed into your cluster (at the price of reduced convenience).

Timo Reimann
  • 9,359
  • 2
  • 28
  • 25