Slide 1

Slide 1 text

Intro to Kubernetes Christopher M Luciano

Slide 2

Slide 2 text

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

Slide 3

Slide 3 text

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

Slide 4

Slide 4 text

Building an Application My application

Slide 5

Slide 5 text

Deploying Super_bash_script_deluxe.sh Upgrade_to_the_max.sh

Slide 6

Slide 6 text

Deploying better_upgrader_in_python.py

Slide 7

Slide 7 text

Deploying Better_upgrader_in_python_tests.py Better_upgrader_in_python_tests_with_awesomeframework.py

Slide 8

Slide 8 text

Problem Stacks On Stacks On Stacks

Slide 9

Slide 9 text

Running an Application start_it_up.sh

Slide 10

Slide 10 text

Running an Application

Slide 11

Slide 11 text

Running an Application

Slide 12

Slide 12 text

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

Slide 13

Slide 13 text

Scaling an Application Great Success!!!

Slide 14

Slide 14 text

Scaling an Application Great Success!!!

Slide 15

Slide 15 text

Scaling an Application More traffic, more power

Slide 16

Slide 16 text

Scaling an Application Not enough traffic, need less servers

Slide 17

Slide 17 text

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

Slide 18

Slide 18 text

Upgrading an application

Slide 19

Slide 19 text

Upgrading an application Display update 5 of 20 machines

Slide 20

Slide 20 text

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

Slide 21

Slide 21 text

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

Slide 22

Slide 22 text

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

Slide 23

Slide 23 text

Scheduling an Application One application to rule, them all

Slide 24

Slide 24 text

Scheduling an Application

Slide 25

Slide 25 text

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

Slide 26

Slide 26 text

Problem I need to be sure that I can rearrange cars efficiently, when a large SUV needs to get to the Penguins game now!

Slide 27

Slide 27 text

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

Slide 28

Slide 28 text

Kubernetes Welcome to The Presentation

Slide 29

Slide 29 text

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

Slide 30

Slide 30 text

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

Slide 31

Slide 31 text

Core Concepts

Slide 32

Slide 32 text

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

Slide 33

Slide 33 text

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

Slide 34

Slide 34 text

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

Slide 35

Slide 35 text

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

Slide 36

Slide 36 text

Demo time ● Excellent

Slide 37

Slide 37 text

Managed Kubernetes ● Bluemix.net

Slide 38

Slide 38 text

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

Slide 39

Slide 39 text

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