Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Traefik + RiksTV

Avatar for Containous Containous
February 21, 2019

Traefik + RiksTV

Traefik Online Meetup: RiksTV's Cloud Infrastructure Using Traefik. A Deep Dive and Demo by Trond Hindenes, SRE team lead at RiksTV

Description:
RiksTV is a Norwegian broadcast distributor and streaming services provider. Trond Hindenes, is the SRE team lead at RiksTV.

Traefik has been an important part of RiksTVs cloud infrastructure since day one, both for traditional services and for our Kubernetes-based workloads. In this session Trond will show how Traefik fits into RiksTVs stack, and how it fits together with other products such as ALB, Kubernetes and Consul.

Avatar for Containous

Containous

February 21, 2019
Tweet

Other Decks in Technology

Transcript

  1. What is RiksTV - Traditionally, very Windows/.Net-centric - Currently moving

    all our stuff to AWS - Mix of “traditional vm” and kubernetes-based infrastructure
  2. Traefik usage at RiksTV - “Everything” passes thru Traefik -

    We use it both for non-containerized and containerized (K8s) services
  3. Some design points - Traefik nodes are defined in CloudFormation,

    we can increase capacity in a matter of minutes - SSL termination happens at ALB (we don’t use Traefik’s awesome LetsEncrypt integration) - Use aggressive health checking from ALB to Traefik - Consul Tags dictate internal/external endpoint - completely up to devs
  4. Learnings from incidents and close calls - Take care to

    design the shutdown/drain process properly (Traefik has all the bells and whistles - use them!) - “stale” consul setting adds robustness - As always, watch open file descriptors - you could exceed the default if you get significant traffic (we did)
  5. All the logs! - Traefik produces a json-structured log format,

    which is super-easy to parse in logstash etc - We’re moving from vm-based to traefik-based access logging
  6. Dev responsibility - Add a “Consul Service definition” file to

    the app (which we pick up automatically during deploy) - Add a robust health endpoint
  7. Traefik in Kubernetes at RiksTV - RiksTV is in a

    state of “Kubernetes ramp-up” - we use it for most new services (and are slowly refactoring old ones too) - Challenge: Clean separation between “external” and “internal” endpoints -
  8. Traefik Kubernetes Design - Each Kubernetes worker has 4 traefik

    instances configured in Daemonsets - Traefik pods are published using HostPort (known port) - ALB is “aggressively probing” for health
  9. Things we learned - Use “terminationGracePeriodSeconds” to allow draining connections

    when shutting down (again, Traefik has all the bells and whistles to make this work nicely) - Use regular CI/CD pipeline to deploy Traefik pod updates (make sure to use “RollingUpdate” in DaemonSet
  10. Dev responsibility - We’ve abstracted away all Kubernetes minutae into

    our custom “ContainerDeploymentV2” library - Devs simply set hostnames, and internal/external and we do the rest
  11. Bonus Track: Hybrid request routing - Strangler-pattern type scenarios where

    some requests should be routed to “legacy intra” and some to kubernets-based pods