Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Containerization primatives
Search
Sam Kottler
November 05, 2014
Technology
180
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Containerization primatives
Sam Kottler
November 05, 2014
Transcript
29 slides
CONTAINERIZATION PRIMITIVES Sam Kottler @samkottler
ABOUT ME • Work at DigitalOcean as a systems engineer
• Formerly of Red Hat, Venmo, Acquia • Committer/core for Puppet, Ansible, Fedora, CentOS, RubyGems, Bundler
WE’RE GONNA BE TALKING ABOUT LINUX
GOOD TO KNOW’S • What is a syscall • Basic
understanding of linux networking • Containers vs. virtualization
WHY DO WE CARE ABOUT ANY OF THIS?
CONTAINERS ARE THE PAST *, PRESENT, AND FUTURE * Most
of the linux ideas are poached from other OS’s
VIRTUALIZATION HAS BECOME MASSIVELY POPULAR BECAUSE OF ITS ECONOMICS
CONTAINERS ARE BECOMING MASSIVELY POPULAR BECAUSE THEY ALLOW LOGICAL SEPARATION
APPLICATION VS. FULL CONTAINERS
NETWORKS, USERS, AND PROCESSES
NAMESPACES • mnt: filesystem • pid: process • net: network
• ipc: SysV IPC • uts: hostname • user: UID
THE BASICS • Namespaces do not have names • Six
inodes exist under /proc/<pid>/ns • Each namespace has a unique inode
USERSPACE TOOLING • iproute2 • util-linux • systemd
NAMESPACE SYSCALLS • unshare() • moves existing process into a
new namespace • clone() • creates new process and namespace • setns() • joins an existing namespace
NETWORK ISOLATION • One namespace per networking device • Single
default namespace, init_net(*nets) • A lo device is included in every ns_net.
NETWORK NAMESPACES IN PRACTICE • ip netns add testns1 •
creates /var/run/netns/testns1 • route management per-NS • prevents cross-NS bonds • setns(int fd, int nstype) • validates namespace type vs. FD
SOCKET ISOLATION • Sockets are mapped into network namespaces •
Also part of a single network namespace • sk_net is part of the sock struct • sock_net()/sock_net_set() getter/setter
SOCKET ACTIVATION • Listen on a socket, but have no
services behind it • Request arrives, service is spun up, responds • Enabling 10k+ low-usage services on a VM
USER ISOLATION • Allows non-privileged usage • Often used as
the start of a namespace chain • UID’s come from the overflow rules
CGROUPS • Resource management • Around since 2006/2007 • Widely
used by userspace management tools
CGROUPS + NAMESPACES • “This PID can only see part
of the filesystem” • “This PID can only see part of the filesystem, use 384mb of memory, and utilize a single CPU.”
CGROUP IMPLEMENTATION • Hooks into fork() and exit() • VFS
of a new type called “cgroup” • More complex descriptors for task_struct • Procfs entry in /proc/<pid>/cgroup • All actions take place on the FS
CGROUP MANAGEMENT • 4 files per-cgroup • tasks • cgroup.procs
• cgroup.event_control • notify_on_release
CPU • Split into “shares” • Default is 2048 shares
• Linear CPU time use
MEMORY • Exposes most of the memory subsystem • NUMA
management • Most complex type of cgroup
LETS TALK ABOUT SECURITY…
SHARING A KERNEL IS INHERENTLY LESS SECURE
KERNEL VULNERABILITIES AROUND BREAKOUT ARE USUALLY MITIGATED BY RUNNING SERVICES
NON- PRIVILEGED
THANKS! • @samkottler • https://github.com/skottler •
[email protected]
More Decks by Sam Kottler
See All by Sam Kottler
This is your database on Linux
skottler
0
310
How to Debug Anything - DevOpsDay PGH
skottler
1
1.3k
Icinga at DigitalOcean
skottler
1
1k
PuppetConf '14
skottler
0
240
Configuration Management Anti-Patterns
skottler
2
1.3k
Other Decks in Technology
See All in Technology
AI時代の組織作り:チーム開発から「個人×AI」への移行と、持続可能な「開発資本」の築き方
ham0215
3
830
サボる子はいねぇがー!AgentCoreハーネスの脆弱性に学ぶ、エージェントの入力バリデーション
iwamot
PRO
5
330
bpf_arenaとstruct_opsを使うのが難しかった話
masu_mi
0
230
業務でAWSをあまり使っていない私が、AWSへのモチベを保つ方法
smt7174
0
190
Linuxネットワークスタック進化の軌跡: 過去10年の歩みと最新トレンド
orimanabu
2
570
AWSを利用する上で知っておきたい名前解決の話 2026
nagisa53
5
3.6k
少ない人手 限られた予算 それでも守る 消せない・見つける・戻れる オールハザード型BCP on AWS / 20261107 Mitsutoshi Matsuo
shift_evolve
PRO
0
370
会社説明資料_最新版
demaecan
0
32k
Claude Codeで新規事業を伸ばせるか? Zennの試行錯誤の記録
wadayusuke
2
160
Context != Context: One window, many lifecycles (AI Native DevCon, Nov 2026)
birgitta410
0
120
Kiro CLI 入門 (ターミナルと CI で使う) | 目指せ Kiro マスター 03
inariku
PRO
2
140
うちなーぐちが認識できるなら、秋田弁もいけるはず!? Amazon Transcribe方言チューニング検証
ryouto715
1
170
Featured
See All Featured
Building AI with AI
inesmontani
PRO
1
1.4k
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
350
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
A Tale of Four Properties
chriscoyier
163
24k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.4k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
1
310
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
35
2.9k
[Rails World 2026] Durable orchestration on Rails: from continuation to workflow
palkan
4
1.2k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
380
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.4k
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
1
300
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.5k