Intro to Kubernetes

Intro to Kubernetes

Why Should I learn about Kubernetes and what are some basics

https://www.youtube.com/watch?v=wjOFupwbpX4&t=3444s

Eeeef19a021df79e7c04827de50193c6?s=128

Christopher M Luciano

June 15, 2017
Tweet

Transcript

  1. Intro to Kubernetes Christopher M Luciano

  2. About Me • Advisory Software Engineer @ IBM • Part

    of Open Source Technology Team in IBM Digital Business Group • Work on Kubernetes and other Cloud Native Computing Foundation (CNCF) projects • @cmluciano_ on Twitter
  3. Index • Who and Why Kubernetes • Kubernetes Architecture •

    Kubernetes Application Concepts • Demo • Can someone else run this for me?
  4. Building an Application My application

  5. Deploying Super_bash_script_deluxe.sh Upgrade_to_the_max.sh

  6. Deploying better_upgrader_in_python.py

  7. Deploying Better_upgrader_in_python_tests.py Better_upgrader_in_python_tests_with_awesomeframework.py

  8. Problem Stacks On Stacks On Stacks

  9. Running an Application start_it_up.sh

  10. Running an Application

  11. Running an Application

  12. Problem My application is a daily menu sign on a

    breezy day Sign falls down -> pick up -> return to step 1
  13. Scaling an Application Great Success!!!

  14. Scaling an Application Great Success!!!

  15. Scaling an Application More traffic, more power

  16. Scaling an Application Not enough traffic, need less servers

  17. Problem I need my organic orange juice consumption to not

    be affected by the rise and fall of traffic to my service.
  18. Upgrading an application

  19. Upgrading an application Display update 5 of 20 machines

  20. Upgrading an application Oh no Video 3 is there!!!

  21. Upgrading an Application Need to add another arbitrary metric for

    “Is It Working” next time
  22. Problem I have a lot of avocados here but I

    only want the ones that will yield guacamole TONIGHT!!!
  23. Scheduling an Application One application to rule, them all

  24. Scheduling an Application

  25. Scheduling an Application Need to add another arbitrary metric for

    “Is It Working” yet again
  26. Problem I need to be sure that I can rearrange

    cars efficiently, when a large SUV needs to get to the Penguins game now!
  27. Summary of Problems ◦ Capacity management during peak times ◦

    Scheduling for unpredictability ◦ Reliable upgrades ◦ Deploying the same way every time ◦ Allow the machines to monitor and fix themselves
  28. Kubernetes Welcome to The Presentation

  29. Kubernetes Master Components • Etcd ◦ Backing datastore for K8s

    ◦ Stores all cluster related information • Kube-apiserver ◦ From end API server for Kubernetes that exposes the Kube API to clients • Kube-controller-manager ◦ Runs Kube controllers that perform routine tasks like populating endpoints, tracking nodes that appear and leave, etc • Kube-scheduler ◦ Watches for new pod creations that are not running and finds a node for them to run on
  30. Kubernetes Node Components • Kubelet ◦ Collects all resources and

    detail on a given worker node and exposes them for scheduling ◦ Also takes care of the pod lifecycle which includes mounting volumes, downloading dependencies, etc. • Kube-proxy ◦ Maintains network rules and connection forwarding ▪ Normally done through IPtables • Container Runtime ◦ Rkt ◦ Docker • Supervisord ◦ Babysits the kubelet as systemd would
  31. Core Concepts

  32. Container • Basic building block • Should contain one process

    or application • Ex. https://gist.github.ibm.com/cmluciano/b52e3764b3bdcb826ae37b039d9f b2be
  33. Pod • Collection of containers ◦ Can store things in

    a pod specific scratch space ◦ Can talk to each other over localhost ◦ Scheduled to a node as a group • Ex. https://gist.github.ibm.com/cmluciano/b52e3764b3bdcb826ae37b039d9fb2 be
  34. ReplicaSet • Schedules new pods based on desired number •

    Takes care of babysitting your pods and recreating whenever necessary • Should be grouped together with labels as a selector • Should most likely be used through a deployment • Ex. https://gist.github.ibm.com/cmluciano/b52e3764b3bdcb826ae37b039d9fb2be
  35. Service • Collect multiple pods together into related groupings based

    on labels • RS front-end communicates with RS backend to create service X • Creates an IP that represents the whole service and load balances appropriately
  36. Demo time • Excellent

  37. Managed Kubernetes • Bluemix.net

  38. IBM Cloud Kubernetes • Native K8s APIs • Fully managed

    HA installation • IBM Cloud LoadBalancer • Support for Ingress • IBM Cloud registry • Container security scanning • Ease access to other IBM Cloud services like Watson and Compose.io
  39. Questions? • Christopher M Luciano • cmluciano@us.ibm.com • github.com/cmluciano •

    @cmluciano_ on Twitter