-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDocker and Kubernetes - The Big Picture
228 lines (190 loc) · 7.75 KB
/
Docker and Kubernetes - The Big Picture
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
Docker and Kubernetes: The Big Picture
Module 01: Course Overview
Basics on containers
Docker and Kubernetes
Microservices and cloud-native
Thrive in a container world
Current state of the union
Module 02: Course Introduction
Course Intro
Aim of the game
Get up to speed
Give directions
Cover fundamentals
Containers Primer
What are containers? cf. to VM?
How about Microservices and cloud native?
Docker
Kubernetes
How to prepare (as individuals and organizations) - to thrive ina container world?
Different types of workloads and apps - if there are good fit for container?
Enterprise & Production Readiness - how do they fit together?
products availbe
what works vs. what doesn't
Orchestration
What's next
Module 03: Containers: Primer
Containers: Primer
What is container, microservices, cloud native
The Bad Old Days
Applications run business -> no applications, no business
Applications (mostly) run on service
Around early to mid-2000, (mostly) one app per server (big and expensive)
Scenario:
Business needs a new application
IT needs to buy a new server - expensive up front and after
Hard to estimate how big or how fast the server needs to be
Error on the safe side - big and fast server
But what a waste of resources!
Hello VMware / Hypervisors
Extract more performance out of the same hardware
Run multiple applications on single server
VM Warts
Shaort coming of VMware / Hypervisors
Single server host multiple VM
Each VM utilize part of the whole resource
Each VM requires own OS
Duplication of OS cause wastes in:
hardware resources
licensing fee
admin cost
security / anti-virus
patch
update and more...
Containers
One server, one OS, multiple applications
For each application, there is a container
Each container is a part of OS
Containers are smaller and more efficient / run app faster
Container Demo
ubuntu w/ Docker
log on to host (linux server with Docker installed)
The server can be VM/ bare metal or a laotop
Docker does Linux and Windows
In general,
Docker on Linux only runs Linux app
Docker on Windows only runs Windows app
command: docker image ls
An image is a pre-packed application / VM template - everything needed to run an app in single bundle
To fire up an container from an image:
command: docker container run -d --name web -p 8080:8080 nigelpoulton/ctr-demo:1
Interpretation:
docker container run - run a new container
nigelpoulton/ctr-demo:1 - off this image (specified here)
web -p 8080:8080 - expose it on the network port (specified here)
After command is executed, there is an unique ID of the container displayed that is up and running
For user, the necessary information is the IP address (34.247.174.207) of the server
and that the application is exposed on port 8080
ex. The application can be accessed from browser with following URL: 34.247.174.207:8080
To stop container:
command: docker stop web
To restart container:
command: docker container start web
Recap
Modernizing traditional app: move legacy app into containers
Microservices
Cloud native
Monolith / legacy app
single binary / program to do all: Web, Search, Auth, Stock, Cart, Check out, etc...
Hard to fix one part without moving others
The only way to roll out a fix is to take the entire app down
Microservices / Cloud native
- build & manage app in a way to cloud computing requirement,
so individual services (like front end) can be scaled independent of other parts (like back end)
and each feature can be iterate independently
- can be deployed in cloud enviornment or on-prem
Developer only need to touch smaller subset of the code base to update feature
Ops only need to launch updated version of the updated service
Containers =
virtualization 2.0 - improved upon Hypervisors and pave the way for Microservices / Cloud native apps
Containers and virtualization lives side by side (No complete replacing VM with containers)
Module 04: Docker
Docker
The company - Docker, Inc.
The technology - Docker Project
Docker, Inc. (SF company)
Start as dotCloud - provide developer platform on top of AWS
Containers are used to work with AWS and in-house tooling that go with it
The technology known as docker = dock + worker
Different way to build and ship software
Docker the Technology
Container = fast light-weight VM
Docker makes it easy to run app inside container
Containerizing Apps
Open source on GitHub
Community Edition (CE)
Open source w/ many contributors
Quick release cycle
Enterprise Edition (EE)
Slower release cycle
Additional features
Official support (contract)
Docker Demo w/ workflow
A typical app...
Web, API Gateway, Catalog, Shopping Cart
In cloud native microservices context, each services was coded saperately, within its own container
so that each service can be fixed/ updated independent of the rest
To begin...
1. Take code
2. Build into docker image (stopped container / template on how to build a container)
3. Push image to registry
4. Start container from registry
Step 1:
Move to directory with from project directory that holds all dependencies
command: docker image build -t nigelpoulton/ctr-demo:2 .
docker image build - tell docker to build image
nigelpoulton/ctr-demo:2 - this is what the image will be called
. - build image file out of all the files in this diectory and below
This command takes codes and package them as an image (stopped content)
command: docker image ls nigelpoulton/ctr-demo:2
command: docker image push nigelpoulton/ctr-demo:2
This will push image to docker hub registry
On-prem registry can also be used
command: docker container run -d --name web -p 8000:8080 nigelpoulton/ctr-demo:2
This will run the app
The app noe wuns on localhost:8000
Docker Summary
This is the key to move to modern cloud native microservices design
How to scale: docker swarm or Kubernetes
Module 05: Kubernetes
Kubernetes
Kubernetes: History
Google: Services like gmail or search are run on containers
In-house technology to manage all these containers: Borg -> Omega -> Kubernetes
Cloud Native Computing Foundation
Kubernetes is backed by manay organizations:
Amazon, Azure, Google all host Kubernetes services
IBM and many others
Kubernetes can be on-prem as well (backed by service contracts), even on laptop development environments
Kubernetes: The Short and Skinny
It does most things
Docker provide ability to start / stop delete individual container - low level mechanism
Kubernetes focus on - "conducting" scheduling, scaling, healing, updating of individual containers
- higher level mechanism
How many containers draw on it
Which node to run them on
When to scale up or down
Update container without downtime
Recap
Module 06: Preparing to Thrive in a Container World
Preparing to Thrive in a Container World
Individual Preparedness
Organization Preparedness
Recap
Module 07: Suitable Workloads
Suitable Workloads
Low-hanging Fruit
State & Legacy Apps
Recap
Module 08: Enterprise and Production Readiness
Enterprise and Production Readiness
Docker
Kubernetes
Ecosystem
Summary
Module 09: A Word on Orchestration
A Word on Orchestration
Orchestration
Summary
Module 10: What Next?
What Next?