Skip to Content
Kubernetes即学即用(第二版)
book

Kubernetes即学即用(第二版)

by Brendan Burns, Joe Beda, Kelsey Hightower
June 2021
Intermediate to advanced
300 pages
5h 4m
Chinese
China Electric Power Press Ltd.
Content preview from Kubernetes即学即用(第二版)
Pod
63
gcr.io/kuar-demo/kuard-amd64:blue
如果将示例
5-1
保存到
kuard-pod.yaml
文件,然后通过
kubectl
命令将该清
单加载到
Kubernetes
,则可以得到类似的结果。
示例
5-1
kuard-pod.yaml
apiVersion:
v1
kind:
Pod
metadata:
name:
kuard
spec:
containers:
- image:
gcr.io/kuar-demo/kuard-amd64:blue
name:
kuard
ports:
- containerPort:
8080
name:
http
protocol:
TCP
5.4
运行
Pod
在上一节中,我们创建了一个
Pod
清单,可用于启动并运行
kuard Pod
。下面
我们使用
kubectl apply
命令启动
kuard
的一个实例:
$
kubectl apply -f kuard-pod.yaml
这个命令可以将
Pod
清单提交到
Kubernetes API
服务器。然后,由
Kubernetes
系统将该
Pod
调度到集群中运行状况良好的节点上,然后再由
kubelet
守护进程对其进行监控。如果你不理解这段描述的
Kubernetes
的所
有动作,也不必担心。我们会在后续章节中介绍更多细节。
5.4.1
查询
Pod
列表
现在,我们的一个
Pod
已经在运行中了,下面我们来进一步了解它。我们可
以使用
kubectl
命令行工具列出集群中所有正在运行的 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

PyTorch深度学习

PyTorch深度学习

Posts & Telecom Press, Vishnu Subramanian
Python数据分析

Python数据分析

Posts & Telecom Press, Ivan Idris
Python贝叶斯分析(第2版)

Python贝叶斯分析(第2版)

Posts & Telecom Press, Osvaldo Martin
Python高级编程(第2版)

Python高级编程(第2版)

Posts & Telecom Press, Michał Jaworski, Tarek Ziadé

Publisher Resources

ISBN: 9787519856762