没有合适的资源?快使用搜索试试~ 我知道了~
首页the kubernetes book-2019 march
the kubernetes book-2019 march
需积分: 10 69 浏览量
更新于2023-05-23
评论
收藏 3.68MB PDF 举报
Containers are here and resistance is futile! Now that people are getting their heads around Docker, they need an orchestration platform to help them manage their containerized apps. Kubernetes has emerged as one of the hottest and most important container orchestration platforms in the world. This book gets you up to speed fast!
资源详情
资源评论
资源推荐


The Kubernetes Book
Nigel Poulton
This book is for sale at http://leanpub.com/thekubernetesbook
This version was published on 2019-03-09
This is a Leanpub book. Leanpub empowers authors and publishers with the Lean Publishing
process. Lean Publishing is the act of publishing an in-progress ebook using lightweight tools and
many iterations to get reader feedback, pivot until you have the right book and build traction once
you do.
© 2017 - 2019 Nigel Poulton

Education is about inspiring and creating opportunities. I hope this book, and my video training
courses, inspire you and create some great new opportunities!
A huge thanks to my family for putting up with me. I’m a geek who thinks he’s software running on
midrange biological hardware. I know it’s not easy living with me.
Thanks as well to everyone who watches my Pluralsight and A Cloud Guru training videos. I love
connecting with you and appreciate all the feedback I’ve had over the years. That is what inspired me
to write this book. I think you’ll love it, and I hope it helps drive your career forward.
@nigelpoulton

Contents
0: About the book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Paperback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Audio book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
eBook and Kindle editions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Feedback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Why should anyone read this book or care about Kubernetes? . . . . . . . . . . . . . . . . 2
Should I buy the book if I’ve already watched your video training courses? . . . . . . . . . 2
Free updates to the book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Versions of the book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1: Kubernetes primer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Kubernetes background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Where did Kubernetes come from . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
A data center OS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Chapter summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2: Kubernetes principles of operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Kubernetes from 40K feet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Masters and nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Packaging apps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
The declarative model and desired state . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Pods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Deployments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Chapter summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
3: Installing Kubernetes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Play with Kubernetes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Docker Desktop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Minikube . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Google Kubernetes Engine (GKE) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Installing Kubernetes on AWS with kops . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Installing Kubernetes with kubeadm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45

CONTENTS
kubectl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
Chapter summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
4: Working with Pods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
Pod theory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
Hands-on with Pods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
Chapter Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
5: Kubernetes Deployments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
Deployment theory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
How to create a Deployment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Performing a rolling update . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
How to perform a rollback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
Chapter summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
6: Kubernetes Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
Setting the scene . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
Theory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
Hands-on with Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
Real world example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
Chapter Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
7: Kubernetes storage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
The big picture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
Storage Providers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
The Container Storage Interface (CSI) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
The Kubernetes persistent volume subsystem . . . . . . . . . . . . . . . . . . . . . . . . . . 102
Storage Classes and Dynamic Provisioning . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
Demo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
Chapter Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
8: Other important Kubernetes stuff . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
DaemonSets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
StatefulSets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
Jobs and CronJobs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
Autoscaling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
Role-based access control (RBAC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
Helm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
Chapter Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
9: Threat modeling Kubernetes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
Threat model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
Spoofing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
Tampering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
剩余164页未读,继续阅读














安全验证
文档复制为VIP权益,开通VIP直接复制

评论0