1 / 106

April 30, 2019

Load Balancing with Kubernetes: concepts, use-cases, and implementation details Kubernetes Master Class Series. #Rancherk8s. April 30, 2019. Murali Paluru Principal Software Engineer Rancher Git: leodotcloud @ leodotcloud. Matthew Scheer Marketing Manager Rancher

maddox
Download Presentation

April 30, 2019

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Load Balancing with Kubernetes: concepts, use-cases, and implementation detailsKubernetes Master Class Series #Rancherk8s April 30, 2019

  2. Murali Paluru Principal Software Engineer Rancher Git: leodotcloud @leodotcloud Matthew Scheer Marketing Manager Rancher     @matthew_scheer matthew@rancher.com #RancherK8s

  3. Rancher Master Class Series: Trying to keep this to 40-45 minutes Questions are always welcome Use the questions tab to write your questions We may respond to all, so mark your question as private if needed. #Rancherk8s

  4. This session is being recorded! http://youtube.com/c/rancher #Rancherk8s

  5. Join the conversation on Slack http://slack.rancher.io #masterclass #RancherK8s

  6. Upcoming Classes http://rancher.com/kubernetes-master-class/ More Resources https://info.rancher.com/kubernetes-networking-deep-dive #RancherK8s

  7. Load Balancing in K8S Murali Paluru • https://slack.rancher.io(leodotcloud)https://github.com/leodotcloud • https://twitter.com/leodotcloudhttps://linkedin.com/in/leodotcloud

  8. Agenda • Load Balancer: What/Why • Load Balancer types • L4 • L7 • LB in K8S (Internal/External) • Service Types: ClusterIP, NodePort, LoadBalancer • Ingress • Demo • Questions Code will be uploaded here: https://github.com/leodotcloud/k8s-load-balancing-master-class

  9. What is Load Balancing/a Load Balancer? • Load balancing refers to efficiently distributing incoming network traffic across a group of backend servers/microservices. • A Load Balancer is a device(physical/virtual) that distributes network or application traffic across a cluster of servers.

  10. Summarize

  11. Summarize SSL Offloading Load Distribution Routing (Host/Path) Version Upgrades

  12. ??? Questions ???

  13. Many Load Balancers! • HAProxy • Nginx • F5 • Cisco • Avi • Cloud Providers (AWS, GCE, Azure, DO, etc.) • etc

  14. Load Balancer Types • L4 (Layer 4) • Inspects the packet only upto Layer 4 of the networking stack (TCP/UDP) • L7 (Layer 7), Application Load Balancer • Inspects the packet all the way up to Layer 7 of the networking stack (HTTP/HTTPS) Image Source

  15. Comparison • Layer 7 LB • Load distribution • SSL offloading • App Upgrades • Routing • Layer 4 LB • Load distribution • SSL offloading • App Upgrades

  16. Load Balancer Types

  17. Kubernetes

  18. Cluster IP • Layer 4 Load balancing (Provides Load distribution, Version Upgrades) • Internal to the cluster • Configured via K8S Service • Service Discovery using name of the service • There are no network interfaces associated with the Cluster IP. • If you want to expose your application, always use a Cluster IP, do not rely on the POD IP address. • Pods and their IP addresses are ephemeral! • Majority of DNS clients are not good citizens. (More info here)

  19. Service discovery • Within the same namespace, services are discoverable using their names. • service-name • Across different namespaces, services are discoverable using the format: • service-name.namespace-name • Default domain: cluster.local • DNS A records: service-name.namespace-name.svc.cluster.local

  20. Cluster IP

  21. Cluster IP

  22. Cluster IP Internal Clients

  23. Cluster IP - Demo Setup

  24. Cluster IP - Demo Setup

  25. Cluster IP - Demo Setup

  26. Cluster IP - Demo Setup

  27. Cluster IP - Demo Setup

  28. Sample App for Demo purposes • Docker image: leodotcloud/swiss-army-knife • Single Go binary that serves a web server on a given port • Renders a simple webpage • Displays English alphabets and their mapping NATO phonetic alphabets • Displays the hostname and IP address of container • Has all basic tools needed for debugging • Environments Variables • PORT: Specify the port for the web server to listen on • Default: 80 • ALPHABET: To show a specific alphabet only • Default: “” (shows all alphabets)

  29. ??? Questions ???

  30. ClusterIP - Demo

  31. NodePort • Layer 4 Load balancing (Provides Load distribution, Version Upgrades) • External access using a “port of all nodes” • Under the hood, creates an internal Cluster IP for LB purposes • And NO service discovery for external clients • Note: Can be accessed on/over the internet if the node IP addresses are public (Or Direct Connect/VPN)

  32. NodePort

  33. NodePort

More Related