When to rm -rf Kubernetes Paul Steele #IndyCloudConf About Me - - PowerPoint PPT Presentation

when to rm rf kubernetes
SMART_READER_LITE
LIVE PREVIEW

When to rm -rf Kubernetes Paul Steele #IndyCloudConf About Me - - PowerPoint PPT Presentation

When to rm -rf Kubernetes Paul Steele #IndyCloudConf About Me Software Engineer at SEP Purdue University https://blog.paul-steele.com/ #IndyCloudConf Kubernetes at home #IndyCloudConf Setting up Clusters #IndyCloudConf


slide-1
SLIDE 1

When to rm -rf Kubernetes

Paul Steele

#IndyCloudConf

slide-2
SLIDE 2

About Me

  • Software Engineer at SEP
  • Purdue University
  • https://blog.paul-steele.com/

#IndyCloudConf

slide-3
SLIDE 3

Kubernetes at home

#IndyCloudConf

slide-4
SLIDE 4

Setting up Clusters

#IndyCloudConf

slide-5
SLIDE 5

Developing for clusters

#IndyCloudConf

slide-6
SLIDE 6

You can run Docker containers without Kubernetes

#IndyCloudConf

slide-7
SLIDE 7
slide-8
SLIDE 8
slide-9
SLIDE 9

Who has used...

  • Containers?

#IndyCloudConf

slide-10
SLIDE 10

Who has used...

  • Containers?
  • Container Orchestrators?

#IndyCloudConf

slide-11
SLIDE 11

Who has used...

  • Containers?
  • Container Orchestrators?
  • Kubernetes?

#IndyCloudConf

slide-12
SLIDE 12

Agenda

  • Containers & Container Orchestration
  • Kubernetes

○ What does it offer? ○ When it isn’t ideal ○ When it is ideal

  • Do I need Kubernetes?

○ alternatives

#IndyCloudConf

slide-13
SLIDE 13

What are Containers?

#IndyCloudConf

slide-14
SLIDE 14

Containers

  • Packaging for applications

○ Standardized ○ Modular ○ Fast to spin up ○ Portable

#IndyCloudConf

slide-15
SLIDE 15

Like Virtual Machines but not

#IndyCloudConf

slide-16
SLIDE 16

Running Containers

#IndyCloudConf

slide-17
SLIDE 17

Running More Containers

#IndyCloudConf

slide-18
SLIDE 18

...and more containers

#IndyCloudConf

slide-19
SLIDE 19

...too many containers

x 100,000

#IndyCloudConf

slide-20
SLIDE 20

What is Container Orchestration?

#IndyCloudConf

slide-21
SLIDE 21

Container Orchestration

  • Abstraction of underlying hardware

○ Machines ○ Storage ○ Networks

#IndyCloudConf

slide-22
SLIDE 22

Container Orchestration

  • Workload scheduling

#IndyCloudConf

slide-23
SLIDE 23

Container Orchestration

  • Horizontal scaling

#IndyCloudConf

slide-24
SLIDE 24

Container Orchestration

  • Self healing

○ Machine failures ○ App hiccups

#IndyCloudConf

slide-25
SLIDE 25

Container Orchestration

  • Rolling Updates

#IndyCloudConf

slide-26
SLIDE 26

What Orchestrator to Pick?

  • Docker Swarm?
  • Mesos DC/OS?
  • Kubernetes?

#IndyCloudConf

slide-27
SLIDE 27

Kubernetes

  • Open source version of Google’s Borg

○ 1.0 release in July 2015

  • Written in Go
  • Greek for “Helmsman”
  • “Production-Grade Container Orchestration”
  • K8S for short
  • Becoming De-facto orchestrator

#IndyCloudConf

slide-28
SLIDE 28

What does Kubernetes offer?

#IndyCloudConf

slide-29
SLIDE 29

https://kubernetesbootcamp.github.io/kubernetes-bootcamp/

Nodes

slide-30
SLIDE 30

When it makes sense

https://kubernetesbootcamp.github.io/kubernetes-bootcamp/

Nodes

slide-31
SLIDE 31

https://kubernetesbootcamp.github.io/kubernetes-bootcamp/

Pods

slide-32
SLIDE 32

https://kubernetesbootcamp.github.io/kubernetes-bootcamp/

Pods

slide-33
SLIDE 33

https://kubernetesbootcamp.github.io/kubernetes-bootcamp/

Pods

slide-34
SLIDE 34

https://kubernetesbootcamp.github.io/kubernetes-bootcamp/

Services

slide-35
SLIDE 35

https://kubernetesbootcamp.github.io/kubernetes-bootcamp/

Services

slide-36
SLIDE 36

Distinctive Features

  • Role Based Authentication

○ For all actions

#IndyCloudConf

slide-37
SLIDE 37

Distinctive Features

  • Namespaces

○ Isolate resources ○ Share hardware between Test & production

#IndyCloudConf

slide-38
SLIDE 38

When it isn’t ideal

#IndyCloudConf

slide-39
SLIDE 39

When it went wrong

  • Provisioning Tool

○ Custom built ○ Used for allocating customer resources ○ Not containerized at all

#IndyCloudConf

slide-40
SLIDE 40

When it went wrong

  • Minikube for local development
  • Dependencies included:

#IndyCloudConf

slide-41
SLIDE 41

When it went wrong

  • Minikube for local development
  • Dependencies included:

○ Mysql

#IndyCloudConf

slide-42
SLIDE 42

#IndyCloudConf

  • Minikube for local development
  • Dependencies included:

○ Mysql ○ Mongodb

When it went wrong

slide-43
SLIDE 43
  • Minikube for local development
  • Dependencies included:

○ Mysql ○ Mongodb ○ Redis

When it went wrong

slide-44
SLIDE 44
  • Minikube for local development
  • Dependencies included:

○ Mysql ○ Mongodb ○ Redis ○ Jenkins

When it went wrong

slide-45
SLIDE 45
  • Minikube for local development
  • Dependencies included:

○ Mysql ○ Mongodb ○ Redis ○ Jenkins ○ Jenkins Connector

When it went wrong

slide-46
SLIDE 46
  • Minikube for local development
  • Dependencies included:

○ Mysql ○ Mongodb ○ Redis ○ Jenkins ○ Jenkins Connector ○ Jaeger

When it went wrong

slide-47
SLIDE 47
  • Minikube for local development
  • Dependencies included:

○ Mysql ○ Mongodb ○ Redis ○ Jenkins ○ Jenkins Connector ○ Jaeger ○ Elasticsearch

When it went wrong

slide-48
SLIDE 48

When it went wrong

  • Minikube for local development
  • Dependencies included:

○ Mysql ○ Mongodb ○ Redis ○ Jenkins ○ Jenkins Connector ○ Jaeger ○ Elasticsearch ○ LocalStack

slide-49
SLIDE 49

When it went wrong

  • What didn’t this setup include?

#IndyCloudConf

slide-50
SLIDE 50

When it went wrong

  • What didn’t this setup include?

○ A container for the application itself

  • Application is currently 6 months behind

○ No end in sight

#IndyCloudConf

slide-51
SLIDE 51

Kubernetes is not

  • A fix for bad architecture

○ Just because you can, doesn’t mean you should

  • Your architecture

○ It is a place for your architecture to run

#IndyCloudConf

slide-52
SLIDE 52

Kubernetes is not

  • A development only environment

○ Unused configuration

■ Wasted time ■ Introduces bugs

#IndyCloudConf

slide-53
SLIDE 53

Kubernetes is

  • A development + production

environment

Consolidated configurations

#IndyCloudConf

slide-54
SLIDE 54

Kubernetes is not

  • For singular applications

  • verkill

○ Has a high initial cost of setting up ○ Not just for running docker

#IndyCloudConf

slide-55
SLIDE 55

Where Kubernetes Isn’t Ideal

  • Self Hosted

○ Managing K8S is a full time job

■ API server for your infrastructure

○ High recurring cost of maintaining

■ Can get into weird scenarios

#IndyCloudConf

slide-56
SLIDE 56

Where Kubernetes Isn’t Ideal

  • Not taking advantage of the services it offers

○ Service discovery ○ Load balancing ○ Role Based Authentication ○ Configuration management ○ Horizontal scaling

#IndyCloudConf

slide-57
SLIDE 57

When it is ideal

#IndyCloudConf

slide-58
SLIDE 58

Where Kubernetes Is Ideal

  • Running multiple applications that interact with each
  • ther
  • When you can take advantage of the services it offers

○ Service discovery ○ Load balancing ○ Role Based Authentication ○ Configuration management ○ Horizontal scaling

#IndyCloudConf

slide-59
SLIDE 59

Where Kubernetes Is Ideal

  • Microservices

○ The 12 Factor App ○ Guidelines for Software as a Service

#IndyCloudConf

slide-60
SLIDE 60

Codebase

  • All code for an application

lives in one repo

  • Kubernetes configurations live

In source control

https://12factor.net/

#IndyCloudConf

slide-61
SLIDE 61

Configuration

  • Configuration for application doesn’t live in code
  • Key - Value Pairs

○ configMaps ○ Secrets ○ Env vars ○ Mounted files

#IndyCloudConf

https://12factor.net/

slide-62
SLIDE 62

Backing Services

  • Application doesn’t care if

resources are local or not

  • Pods
  • Services

#IndyCloudConf

https://12factor.net/

slide-63
SLIDE 63

Processes

  • Application itself is stateless
  • Data that persists is in backing resource

#IndyCloudConf

https://12factor.net/

slide-64
SLIDE 64

Concurrency

  • Application should be able to scale horizontally
  • Horizontal Pod Autoscalers

○ Cpu ○ Memory ○ custom

#IndyCloudConf

https://12factor.net/

slide-65
SLIDE 65

Disposability

  • Application can be stopped and started at any notice

#IndyCloudConf

https://12factor.net/

slide-66
SLIDE 66

Dev / Prod Parity

  • Use the same services in development & production
  • Change what orchestrator you’re using not

environment

#IndyCloudConf

https://12factor.net/

slide-67
SLIDE 67

Logs

  • App doesn’t concern itself with storage of logs
  • K8S handles it

#IndyCloudConf

https://12factor.net/

slide-68
SLIDE 68

Kubernetes is

  • A bridge between Dev & Ops

○ Ops provides K8S as a service ○ Devs are in charge of their deployments

#IndyCloudConf

slide-69
SLIDE 69

So should I use Kubernetes?

#IndyCloudConf

slide-70
SLIDE 70

Should I use Kubernetes?

  • More than one application?

○ If not, focus on automating its deployment

#IndyCloudConf

slide-71
SLIDE 71

Should I use Kubernetes?

  • Can follow deployment through to production?

○ If not, focus on using docker-compose

#IndyCloudConf

slide-72
SLIDE 72

Should I use Kubernetes?

  • Have the team to support it

○ Or ability to pay someone to (Amazon / Azure) ○ Focus on reducing complexity of application

#IndyCloudConf

slide-73
SLIDE 73

Should I use Kubernetes?

  • Applications follow the 12 factor app?

○ Statelessness ○ Focus on automation / re-architecting application

#IndyCloudConf

slide-74
SLIDE 74

Should I use Kubernetes?

  • Can you take advantage of?

○ Service discovery ○ Load balancing ○ Role Based Authentication ○ Configuration management ○ Horizontal scaling

#IndyCloudConf

slide-75
SLIDE 75

Summary

  • Kubernetes is a tool

○ Pros ○ Cons

  • Can solve many problems

○ Can cause them too

  • For organizations, not projects

#IndyCloudConf

slide-76
SLIDE 76

Questions?

#IndyCloudConf

slide-77
SLIDE 77

Thanks!

  • Slides can be found:

https://info.sep.com/2019indycloudconf

#IndyCloudConf