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即学即用(第二版)
158
11
就像
Kubernetes
的其他资源一样,如果不使用标签选择器,则节点查询命令
将返回集群的所有节点:
$
kubectl get nodes
NAME STATUS AGE
k0-default-pool-35609c18-0xnl Ready 23m
k0-default-pool-35609c18-pol3 Ready 1d
k0-default-pool-35609c18-ydae Ready 1d
k0-default-pool-35609c18-z7tb Ready 1d
使用标签选择器可以根据标签过滤节点。如果想列出标签
ssd
等于
true
的节
点,则可以使用带有
--selector
标志的
kubectl get nodes
命令:
$
kubectl get nodes --selector ssd=true
NAME STATUS AGE
k0-default-pool-35609c18-z7tb Ready 1d
11.3.2
节点选择器
我们可以利用节点选择器限制
Pod
可以在
Kubernetes
集群中的哪些节点上运
行。你可以在创建守护进程集的时候,将节点选择器定义为
Pod
规范的一部分。
示例
11-2
中的守护进程集配置限定
NGINX
只能在拥有
ssd=true
标签集的节
点上运行。
示例
11-2
nginx-fast-storage.yaml
apiVersion: ...
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