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即学即用(第二版)
86
|
第
6
章
表
6
-
2
:选择器操作符
操作符
描述
key=value key
的值等于
value
key!=value key
的值不等于
value
key in (value1, value2)
key
的值属于集合
(value1, value2)
key notin (value1, value2)
key
的值不属于集合
(value1, value2)
key key
已被设置
!key key
未被设置
例如,查询某个没有被设置的键(例如
canary
):
$
kubectl get deployments --selector='!canary'
同样,你可以组合使用正反选择器,如下所示:
$
kubectl get pods -l 'ver=2,!canary'
6.1.4 API
对象中的标签选择器
Kubernetes
对象使用标签选择器引用其他对象组。上一节中使用了简单的字
符串,而下面我们将使用一种需要解析的结构。
由于历史原因(
Kubernetes
不希望破坏
API
的兼容性),
Kubernetes
提供了
两种形式。大多数对象都支持较新且功能更强大的选择器运算符。
选择器
app=alpaca,ver in (1, 2)
可以转化为:
selector:
matchLabels:
app: alpaca
matchExpressions:
- {key: ver, operator: In, values: [1, 2]}
❶
❶
紧凑的
YAML
语法。该行为列表
matchExpressions
中的一项,它定义了 ...
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