Skip to Content
For Enterprise
For Government
For Higher Ed
For Individuals
For Marketing
For Enterprise
For Government
For Higher Ed
For Individuals
For Marketing
Explore Skills
Cloud Computing
Microsoft Azure
Amazon Web Services (AWS)
Google Cloud
Cloud Migration
Cloud Deployment
Cloud Platforms
Data Engineering
Data Warehouse
SQL
Apache Spark
Microsoft SQL Server
MySQL
Kafka
Data Lake
Streaming & Messaging
NoSQL Databases
Relational Databases
Data Science
Pandas
R
MATLAB
SAS
D3
Power BI
Tableau
Statistics
Exploratory Data Analysis
Data Visualization
AI & ML
Generative AI
Machine Learning
Artificial Intelligence (AI)
Deep Learning
Reinforcement Learning
Natural Language Processing
TensorFlow
Scikit-Learn
Hyperparameter Tuning
MLOps
Programming Languages
Java
JavaScript
Spring
Python
Go
C#
C++
C
Swift
Rust
Functional Programming
Software Architecture
Object-Oriented
Distributed Systems
Domain-Driven Design
Architectural Patterns
IT/Ops
Kubernetes
Docker
GitHub
Terraform
Continuous Delivery
Continuous Integration
Database Administration
Computer Networking
Operating Systems
IT Certifications
Security
Network Security
Application Security
Incident Response
Zero Trust Model
Disaster Recovery
Penetration Testing / Ethical Hacking
Governance
Malware
Security Architecture
Security Engineering
Security Certifications
Design
Web Design
Graphic Design
Interaction Design
Film & Video
User Experience (UX)
Design Process
Design Tools
Business
Agile
Project Management
Product Management
Marketing
Human Resources
Finance
Team Management
Business Strategy
Digital Transformation
Organizational Leadership
Soft Skills
Professional Communication
Emotional Intelligence
Presentation Skills
Innovation
Critical Thinking
Public Speaking
Collaboration
Personal Productivity
Confidence / Motivation
Features
All features
Verifiable skills
AI Academy
Courses
Certifications
Interactive learning
Live events
Superstreams
Answers
Insights reporting
Radar Blog
Buy Courses
Plans
Sign In
Try Now
O'Reilly Platform
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即学即用(第二版)
标签与注释
|
89
不要将
Kubernetes API
服务器用作通用数据库。注释适合记录与特定资源高
度相关的少量数据。如果你想在
Kubernetes
中存储数据,但没有明显的关联
对象,则请考虑将数据存储在其他更合适的数据库中。
定义注释
注释键采用的格式与标签键完全相同。但是,由于它们常常用于在工具之间
传递信息,因此键的“命名空间”部分更为重要。举个例子,键可以是:
deployment.kubernetes.io/revision
或
kubernetes.io/change-cause
。
注释值是自由格式的字符串字段。尽管这提供了最大的灵活性,因为用户可
以存储任意数据,但文本没有任何格式验证。例如,有人常常将
JSON
文档
编码为字符串并存储在注释中。请务必注意,
Kubernetes
服务器并不知道注
释值所需的格式。如果使用注释来传递或存储数据,则无法保证数据的有效性,
这会导致追踪错误更加困难。
注释的定义位于每个
Kubernetes
对象通用的
metadata
一节中:
...
metadata:
annotations:
example.com/icon-url: "https://example.com/icon.png"
...
注释不仅非常方便,而且还提供了强大的松散耦合。但是,请谨慎使用注释,
以免无类型数据引发混乱。
6.3
清理
你可以通过以下命令清理我们在本章中用到的所有部署:
$
kubectl delete deployments --all
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深度学习
Posts & Telecom Press, Vishnu Subramanian
Python数据分析
Posts & Telecom Press, Ivan Idris
Python贝叶斯分析(第2版)
Posts & Telecom Press, Osvaldo Martin
Python高级编程(第2版)
Posts & Telecom Press, Michał Jaworski, Tarek Ziadé
Publisher Resources
ISBN: 9787519856762