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即学即用(第二版)
服务发现
101
--port=8080 \
--labels="ver=1,app=alpaca,env=prod"
现在回头看一下我们监视的端点的输出,你会看到在删除并重新创建这些
Pod
时,命令行的输出显示了最新的一组与该服务关联的
IP
地址,如下所示:
NAME ENDPOINTS AGE
alpaca-prod 10.112.1.54:8080,10.112.2.84:8080,10.112.2.85:8080 1m
alpaca-prod 10.112.1.54:8080,10.112.2.84:8080 1m
alpaca-prod <none> 1m
alpaca-prod 10.112.2.90:8080 1m
alpaca-prod 10.112.1.57:8080,10.112.2.90:8080 1m
alpaca-prod 10.112.0.28:8080,10.112.1.57:8080,10.112.2.90:8080 1m
如果从一开始你就想编写放到
Kubernetes
上运行的代码,则可以考虑使用端
点对象。但大多数项目都不属于这种情况!大多数现有系统都习惯于处理不
会经常变化的常规
IP
地址。
7.5.2
手动发现服务
Kubernetes
服务的建立以
Pod
的标签选择器为基础,因此即使不使用服务对象,
也可以直接通过
Kubernetes API
发现服务!下面我们举例说明。 ...
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