Preface |
|
xiii | |
|
|
1 | (14) |
|
|
2 | (1) |
|
The Value of Immutability |
|
|
3 | (1) |
|
Declarative Configuration |
|
|
4 | (1) |
|
|
5 | (1) |
|
Scaling Your Service and Your Teams |
|
|
6 | (1) |
|
|
6 | (1) |
|
Easy Scaling for Applications and Clusters |
|
|
6 | (1) |
|
Scaling Development Teams with Microservices |
|
|
7 | (1) |
|
Separation of Concerns for Consistency and Scaling |
|
|
8 | (2) |
|
Abstracting Your Infrastructure |
|
|
10 | (1) |
|
|
10 | (2) |
|
|
12 | (1) |
|
|
13 | (2) |
|
2 Creating and Running Containers |
|
|
15 | (14) |
|
|
16 | (2) |
|
Building Application Images with Docker |
|
|
18 | (1) |
|
|
18 | (2) |
|
|
20 | (1) |
|
|
21 | (1) |
|
|
22 | (2) |
|
Storing Images in a Remote Registry |
|
|
24 | (1) |
|
The Container Runtime Interface |
|
|
25 | (1) |
|
Running Containers with Docker |
|
|
25 | (1) |
|
Exploring the kuard Application |
|
|
26 | (1) |
|
|
26 | (1) |
|
|
27 | (1) |
|
|
28 | (1) |
|
3 Deploying a Kubernetes Cluster |
|
|
29 | (10) |
|
Installing Kubernetes on a Public Cloud Provider |
|
|
30 | (1) |
|
Installing Kubernetes with Google Kubernetes Engine |
|
|
30 | (1) |
|
Installing Kubernetes with Azure Kubernetes Service |
|
|
30 | (1) |
|
Installing Kubernetes on Amazon Web Services |
|
|
31 | (1) |
|
Installing Kubernetes Locally Using minikube |
|
|
31 | (1) |
|
Running Kubernetes in Docker |
|
|
32 | (1) |
|
|
33 | (1) |
|
|
33 | (1) |
|
|
34 | (2) |
|
|
36 | (1) |
|
|
36 | (1) |
|
|
36 | (1) |
|
|
37 | (1) |
|
|
37 | (2) |
|
4 Common kubectl Commands |
|
|
39 | (8) |
|
|
39 | (1) |
|
|
39 | (1) |
|
Viewing Kubernetes API Objects |
|
|
40 | (1) |
|
Creating, Updating, and Destroying Kubernetes Objects |
|
|
41 | (1) |
|
Labeling and Annotating Objects |
|
|
42 | (1) |
|
|
43 | (1) |
|
|
44 | (1) |
|
|
45 | (1) |
|
Alternative Ways of Viewing Your Cluster |
|
|
45 | (1) |
|
|
46 | (1) |
|
|
47 | (18) |
|
|
48 | (1) |
|
|
48 | (1) |
|
|
49 | (1) |
|
|
50 | (1) |
|
|
50 | (1) |
|
|
51 | (1) |
|
|
52 | (1) |
|
|
52 | (1) |
|
|
53 | (1) |
|
|
54 | (1) |
|
Getting More Information with Logs |
|
|
54 | (1) |
|
Running Commands in Your Container with exec |
|
|
55 | (1) |
|
Copying Files to and from Containers |
|
|
55 | (1) |
|
|
55 | (1) |
|
|
55 | (2) |
|
|
57 | (1) |
|
|
57 | (1) |
|
Advanced Probe Configuration |
|
|
57 | (1) |
|
Other Types of Health Checks |
|
|
57 | (1) |
|
|
58 | (1) |
|
Resource Requests: Minimum Required Resources |
|
|
59 | (1) |
|
Capping Resource Usage with Limits |
|
|
60 | (1) |
|
Persisting Data with Volumes |
|
|
61 | (1) |
|
|
61 | (1) |
|
Different Ways of Using Volumes with Pods |
|
|
62 | (1) |
|
|
63 | (1) |
|
|
64 | (1) |
|
|
65 | (10) |
|
|
65 | (1) |
|
|
66 | (2) |
|
|
68 | (1) |
|
|
68 | (2) |
|
Label Selectors in API Objects |
|
|
70 | (1) |
|
Labels in the Kubernetes Architecture |
|
|
71 | (1) |
|
|
71 | (2) |
|
|
73 | (1) |
|
|
73 | (2) |
|
|
75 | (14) |
|
What Is Service Discovery? |
|
|
75 | (1) |
|
|
76 | (1) |
|
|
77 | (1) |
|
|
78 | (1) |
|
Looking Beyond the Cluster |
|
|
79 | (2) |
|
Load Balancer Integration |
|
|
81 | (2) |
|
|
83 | (1) |
|
|
83 | (1) |
|
|
84 | (1) |
|
kube-proxy and Cluster IPs |
|
|
85 | (1) |
|
Cluster IP Environment Variables |
|
|
86 | (1) |
|
Connecting with Other Environments |
|
|
86 | (1) |
|
Connecting to Resources Outside of a Cluster |
|
|
87 | (1) |
|
Connecting External Resources to Services Inside a Cluster |
|
|
87 | (1) |
|
|
88 | (1) |
|
|
88 | (1) |
|
8 HTTP Load Balancing with Ingress |
|
|
89 | (14) |
|
Ingress Spec Versus Ingress Controllers |
|
|
90 | (1) |
|
|
91 | (1) |
|
|
92 | (1) |
|
Configuring a Local hosts File |
|
|
92 | (1) |
|
|
93 | (1) |
|
|
93 | (1) |
|
|
94 | (2) |
|
|
96 | (1) |
|
|
97 | (1) |
|
Advanced Ingress Topics and Gotchas |
|
|
97 | (1) |
|
Running Multiple Ingress Controllers |
|
|
97 | (1) |
|
|
98 | (1) |
|
|
98 | (1) |
|
|
98 | (1) |
|
|
99 | (1) |
|
Alternate Ingress Implementations |
|
|
100 | (1) |
|
|
101 | (1) |
|
|
101 | (2) |
|
|
103 | (10) |
|
|
104 | (1) |
|
Relating Pods and ReplicaSets |
|
|
104 | (1) |
|
Adopting Existing Containers |
|
|
105 | (1) |
|
|
105 | (1) |
|
Designing with ReplicaSets |
|
|
105 | (1) |
|
|
106 | (1) |
|
|
106 | (1) |
|
|
107 | (1) |
|
|
107 | (1) |
|
|
108 | (1) |
|
Finding a ReplicaSet from a Pod |
|
|
108 | (1) |
|
Finding a Set of Pods for a ReplicaSet |
|
|
108 | (1) |
|
|
109 | (1) |
|
Imperative Scaling with kubectl scale |
|
|
109 | (1) |
|
Declaratively Scaling with kubectl apply |
|
|
109 | (1) |
|
|
110 | (1) |
|
|
111 | (1) |
|
|
112 | (1) |
|
|
113 | (16) |
|
|
114 | (2) |
|
|
116 | (1) |
|
|
117 | (1) |
|
|
118 | (1) |
|
|
118 | (1) |
|
Updating a Container Image |
|
|
119 | (1) |
|
|
120 | (3) |
|
|
123 | (1) |
|
|
123 | (1) |
|
|
123 | (3) |
|
Slowing Rollouts to Ensure Service Health |
|
|
126 | (2) |
|
|
128 | (1) |
|
|
128 | (1) |
|
|
128 | (1) |
|
|
129 | (8) |
|
|
130 | (1) |
|
|
131 | (2) |
|
Limiting DaemonSets to Specific Nodes |
|
|
133 | (1) |
|
|
133 | (1) |
|
|
133 | (2) |
|
|
135 | (1) |
|
|
136 | (1) |
|
|
136 | (1) |
|
|
137 | (12) |
|
|
137 | (1) |
|
|
138 | (1) |
|
|
138 | (4) |
|
|
142 | (2) |
|
|
144 | (4) |
|
|
148 | (1) |
|
|
148 | (1) |
|
13 ConfigMaps and Secrets |
|
|
149 | (14) |
|
|
149 | (1) |
|
|
149 | (1) |
|
|
150 | (3) |
|
|
153 | (1) |
|
|
154 | (1) |
|
|
155 | (1) |
|
Private Container Registries |
|
|
156 | (1) |
|
|
157 | (1) |
|
Managing ConfigMaps and Secrets |
|
|
158 | (1) |
|
|
158 | (1) |
|
|
159 | (1) |
|
|
159 | (2) |
|
|
161 | (2) |
|
14 Role-Based Access Control for Kubernetes |
|
|
163 | (10) |
|
Role-Based Access Control |
|
|
164 | (1) |
|
|
164 | (1) |
|
Understanding Roles and Role Bindings |
|
|
165 | (1) |
|
Roles and Role Bindings in Kubernetes |
|
|
165 | (3) |
|
Techniques for Managing RBAC |
|
|
168 | (1) |
|
Testing Authorization with can-i |
|
|
168 | (1) |
|
Managing RBAC in Source Control |
|
|
168 | (1) |
|
|
168 | (1) |
|
|
169 | (1) |
|
Using Groups for Bindings |
|
|
169 | (2) |
|
|
171 | (2) |
|
|
173 | (6) |
|
Encryption and Authentication with Mutal TLS |
|
|
174 | (1) |
|
|
174 | (1) |
|
|
175 | (1) |
|
Do You Really Need a Service Mesh? |
|
|
176 | (1) |
|
Introspecting a Service Mesh Implementation |
|
|
176 | (1) |
|
|
177 | (1) |
|
|
178 | (1) |
|
16 Integrating Storage Solutions and Kubernetes |
|
|
179 | (18) |
|
Importing External Services |
|
|
180 | (1) |
|
Services Without Selectors |
|
|
181 | (2) |
|
Limitations of External Services: Health Checking |
|
|
183 | (1) |
|
Running Reliable Singletons |
|
|
183 | (1) |
|
Running a MySQL Singleton |
|
|
183 | (4) |
|
Dynamic Volume Provisioning |
|
|
187 | (1) |
|
Kubernetes-Native Storage with StatefulSets |
|
|
188 | (1) |
|
Properties of StatefulSets |
|
|
189 | (1) |
|
Manually Replicated MongoDB with StatefulSets |
|
|
189 | (3) |
|
Automating MongoDB Cluster Creation |
|
|
192 | (3) |
|
Persistent Volumes and StatefulSets |
|
|
195 | (1) |
|
One Final Thing: Readiness Probes |
|
|
195 | (1) |
|
|
196 | (1) |
|
|
197 | (12) |
|
What It Means to Extend Kubernetes |
|
|
197 | (1) |
|
|
198 | (8) |
|
Patterns for Custom Resources |
|
|
206 | (1) |
|
|
206 | (1) |
|
|
207 | (1) |
|
|
207 | (1) |
|
|
207 | (1) |
|
|
208 | (1) |
|
18 Accessing Kubernetes from Common Programming Languages |
|
|
209 | (14) |
|
The Kubernetes API: A Client's Perspective |
|
|
209 | (1) |
|
Open API and Generated Client Libraries |
|
|
210 | (1) |
|
But What About kubectl x? |
|
|
210 | (1) |
|
Programming the Kubernetes API |
|
|
211 | (1) |
|
Installing the Client Libraries |
|
|
211 | (1) |
|
Authenticating to the Kubernetes API |
|
|
212 | (2) |
|
Accessing the Kubernetes API |
|
|
214 | (1) |
|
Putting It All Together: Listing and Creating Pods in Python, Java, and NET |
|
|
214 | (2) |
|
Creating and Patching Objects |
|
|
216 | (1) |
|
Watching Kubernetes APIs for Changes |
|
|
217 | (2) |
|
|
219 | (3) |
|
|
222 | (1) |
|
19 Securing Applications in Kubernetes |
|
|
223 | (20) |
|
Understanding SecurityContext |
|
|
223 | (6) |
|
SecurityContext Challenges |
|
|
229 | (1) |
|
|
229 | (1) |
|
|
230 | (1) |
|
Applying Pod Security Standards |
|
|
231 | (2) |
|
Service Account Management |
|
|
233 | (1) |
|
Role-Based Access Control |
|
|
234 | (1) |
|
|
234 | (2) |
|
|
236 | (3) |
|
|
239 | (1) |
|
|
239 | (2) |
|
|
241 | (1) |
|
|
241 | (2) |
|
20 Policy and Governance for Kubernetes Clusters |
|
|
243 | (16) |
|
Why Policy and Governance Matter |
|
|
243 | (1) |
|
|
244 | (1) |
|
Policy and Governance with Gatekeeper |
|
|
245 | (1) |
|
What Is Open Policy Agent? |
|
|
245 | (1) |
|
|
246 | (1) |
|
|
247 | (3) |
|
Understanding Constraint Templates |
|
|
250 | (1) |
|
|
251 | (1) |
|
|
252 | (1) |
|
|
253 | (2) |
|
|
255 | (2) |
|
|
257 | (1) |
|
|
257 | (1) |
|
|
257 | (2) |
|
21 Multicluster Application Deployments |
|
|
259 | (10) |
|
|
260 | (2) |
|
Starting at the Top with a Load-Balancing Approach |
|
|
262 | (1) |
|
Building Applications for Multiple Clusters |
|
|
263 | (2) |
|
Replicated Silos: The Simplest Cross-Regional Model |
|
|
265 | (1) |
|
|
266 | (1) |
|
Better Flexibility: Microservice Routing |
|
|
267 | (1) |
|
|
268 | (1) |
|
22 Organizing Your Application |
|
|
269 | (22) |
|
|
269 | (1) |
|
Filesystems as the Source of Truth |
|
|
269 | (1) |
|
|
270 | (1) |
|
|
271 | (1) |
|
Managing Your Application in Source Control |
|
|
272 | (1) |
|
|
272 | (1) |
|
Managing Periodic Versions |
|
|
273 | (2) |
|
Structuring Your Application for Development, Testing, and Deployment |
|
|
275 | (1) |
|
|
275 | (1) |
|
|
275 | (2) |
|
Parameterizing Your Application with Templates |
|
|
277 | (1) |
|
Parameterizing with Helm and Templates |
|
|
277 | (1) |
|
Filesystem Layout for Parameterization |
|
|
278 | (1) |
|
Deploying Your Application Around the World |
|
|
279 | (1) |
|
Architectures for Worldwide Deployment |
|
|
279 | (1) |
|
Implementing Worldwide Deployment |
|
|
280 | (2) |
|
Dashboards and Monitoring for Worldwide Deployments |
|
|
282 | (1) |
|
|
282 | (1) |
|
Building Your Own Kubernetes Cluster |
|
|
283 | (8) |
Index |
|
291 | |