1 of 49

What is a Kubernetes?

Adrian Bao | Fall 2024

The Open Computing Facility at UC Berkeley

Slides by Nikhil Jha

2 of 49

Why Kubernetes?

1

3 of 49

A Fundamental Problem in Computer Science:

How do we write software?

4 of 49

A Fundamental Problem in Computer Infrastructure:

How do we run software?

5 of 49

Applications

Resources

Non-logo images: noun project

6 of 49

Problem:

What is the best* way to organize or spend our resources to run this software?

7 of 49

Kubernetes Subproblem:

Given we have a bunch of computers that are already running, how do we best* organize them to run our software?

8 of 49

“best” = ?

“Efficiently”, “at scale”, minimal downtime, in a way that adapts to your org structure (layer 8), etcetc…

9 of 49

“best” = ?

Means different things to different people!

10 of 49

What is Kubernetes?

2

11 of 49

  1. A Database

image: https://pixabay.com/vectors/database-storage-data-storage-152091/

12 of 49

  • A Database
  • Distributed
  • Key / Value
  • Typed

13 of 49

Examples of Objects

  • “Run 5 replicas of X software on unique machines.”
  • “Make X software available at web address hello.example.com.”
  • “Make sure each copy of X has 16 GiB storage.”

14 of 49

Crazier Objects

  • “Create a Postgres database + account for X.”
  • “Run a Minecraft server.”
  • “Make me a coffee at 8:45 AM every morning.”

15 of 49

image: https://stackoverflow.com/questions/46640049

An example of something in the database…

16 of 49

image: https://stackoverflow.com/questions/46640049

typed

An example of something in the database…

17 of 49

image: https://stackoverflow.com/questions/46640049

typed

key

An example of something in the database…

18 of 49

image: https://stackoverflow.com/questions/46640049

CoffeeScheduler

time: “8:30 AM”

Not in Kubernetes by default, but you can make this!

19 of 49

CoffeeScheduler

time: “8:30 AM”

Java logo lol

Not in Kubernetes by default, but you can make this!

20 of 49

2. Controller Software

21 of 49

2. Controller Software

image: https://publicdomainvectors.org/en/free-clipart/Isometric-server-cabinet-vector-graphics/13444.html

22 of 49

3. Standardized APIs

23 of 49

3. Standardized APIs

  • Versioned
  • Stable
  • Universal

24 of 49

image: https://stackoverflow.com/questions/46640049

versioned

An example of something in the database…

25 of 49

3. Standardized APIs

  • Versioned
  • Stable
  • Universal

26 of 49

The other details…

3

27 of 49

“a container orchestration system”

=

28 of 49

“a container orchestration system”

=

yet I haven’t even talked about containers lol… but they’re important!

29 of 49

“Why now and not 30 years ago?”

containers =

30 of 49

container

}

a packaged app

31 of 49

container

}

standard (OCI) sandboxed process

32 of 49

33 of 49

container

}

standard (OCI) sandboxed process

typically implemented as set of isolated processes

}

34 of 49

container

}

standard (OCI) sandboxed process

typically implemented as set of isolated processes

}

}

namespaces (e.x. netns), cgroup, fs

35 of 49

Why is this “better”?

4

36 of 49

1. works on multiple machines

37 of 49

2. declarative infrastructure

38 of 49

SQL : C

Kubernetes : Your OS

39 of 49

Appendix: An Example

5

40 of 49

“Pod” represents the existence of a container

It contains information about the image to run, and the container port

41 of 49

notice that it contains a “template” for what Pod it should create

“Deployment” represents a set of fungible containers

* Note: ReplicaSet is a thing that exists, so I may slightly lie when presenting this slide.

42 of 49

* Note: ReplicaSet is a thing that exists, so I may slightly lie when presenting this slide.

Label, so the controller software for the Deployment can tell which Pod objects it owns

43 of 49

argo.ocf.berkeley.edu (v4)

argo.ocf.berkeley.edu (v6)

44 of 49

45 of 49

argo.ocf.berkeley.edu (v4)

argo.ocf.berkeley.edu (v6)

46 of 49

“MinecraftSet” represents the existence of a group of Minecraft servers

It’s managed by controller software I wrote, hence njha.dev

The configuration options are specific to a Minecraft server (!!)

47 of 49

You can still override the template options for the Pod

Labels are used to organize resources

48 of 49

49 of 49

process::exit(0); // ty