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

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

Christopher M Luciano

June 15, 2017
Tweet

More Decks by Christopher M Luciano

Other Decks in Programming

Transcript

  1. Intro to Kubernetes
    Christopher M Luciano

    View Slide

  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

    View Slide

  3. Index
    ● Who and Why Kubernetes
    ● Kubernetes Architecture
    ● Kubernetes Application Concepts
    ● Demo
    ● Can someone else run this for me?

    View Slide

  4. Building an Application
    My application

    View Slide

  5. Deploying
    Super_bash_script_deluxe.sh Upgrade_to_the_max.sh

    View Slide

  6. Deploying
    better_upgrader_in_python.py

    View Slide

  7. Deploying
    Better_upgrader_in_python_tests.py
    Better_upgrader_in_python_tests_with_awesomeframework.py

    View Slide

  8. Problem
    Stacks
    On
    Stacks
    On
    Stacks

    View Slide

  9. Running an Application
    start_it_up.sh

    View Slide

  10. Running an Application

    View Slide

  11. Running an Application

    View Slide

  12. Problem
    My application is a daily menu sign on a breezy day
    Sign falls down -> pick up -> return to step 1

    View Slide

  13. Scaling an Application
    Great Success!!!

    View Slide

  14. Scaling an Application
    Great Success!!!

    View Slide

  15. Scaling an Application
    More traffic,
    more power

    View Slide

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

    View Slide

  17. Problem
    I need my organic orange juice consumption to not be affected
    by the rise and fall of traffic to my service.

    View Slide

  18. Upgrading an application

    View Slide

  19. Upgrading an application
    Display update 5 of 20
    machines

    View Slide

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

    View Slide

  21. Upgrading an Application
    Need to add another arbitrary
    metric for “Is It Working” next
    time

    View Slide

  22. Problem
    I have a lot of avocados here but I only want the ones that will yield guacamole
    TONIGHT!!!

    View Slide

  23. Scheduling an Application
    One application to rule,
    them all

    View Slide

  24. Scheduling an Application

    View Slide

  25. Scheduling an Application
    Need to add another arbitrary
    metric for “Is It Working” yet
    again

    View Slide

  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!

    View Slide

  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

    View Slide

  28. Kubernetes
    Welcome to The Presentation

    View Slide

  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

    View Slide

  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

    View Slide

  31. Core Concepts

    View Slide

  32. Container
    ● Basic building block
    ● Should contain one process or application
    ● Ex.
    https://gist.github.ibm.com/cmluciano/b52e3764b3bdcb826ae37b039d9f
    b2be

    View Slide

  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

    View Slide

  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

    View Slide

  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

    View Slide

  36. Demo time
    ● Excellent

    View Slide

  37. Managed Kubernetes
    ● Bluemix.net

    View Slide

  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

    View Slide

  39. Questions?
    ● Christopher M Luciano
    [email protected]
    ● github.com/cmluciano
    ● @cmluciano_ on Twitter

    View Slide