Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Kubernetes Cookbook

You're reading from   Kubernetes Cookbook Practical solutions to container orchestration

Arrow left icon
Product type Paperback
Published in May 2018
Publisher Packt
ISBN-13 9781788837606
Length 554 pages
Edition 2nd Edition
Arrow right icon
Authors (3):
Arrow left icon
Hideto Saito Hideto Saito
Author Profile Icon Hideto Saito
Hideto Saito
Hui-Chuan Chloe Lee Hui-Chuan Chloe Lee
Author Profile Icon Hui-Chuan Chloe Lee
Hui-Chuan Chloe Lee
Ke-Jou Carol Hsu Ke-Jou Carol Hsu
Author Profile Icon Ke-Jou Carol Hsu
Ke-Jou Carol Hsu
Arrow right icon
View More author details
Toc

Table of Contents (11) Chapters Close

Preface 1. Building Your Own Kubernetes Cluster FREE CHAPTER 2. Walking through Kubernetes Concepts 3. Playing with Containers 4. Building High-Availability Clusters 5. Building Continuous Delivery Pipelines 6. Building Kubernetes on AWS 7. Building Kubernetes on GCP 8. Advanced Cluster Administration 9. Logging and Monitoring 10. Other Books You May Enjoy

Working with labels and selectors

Labels are a set of key/value pairs, which are attached to object metadata. We could use labels to select, organize, and group objects, such as Pods, ReplicaSets, and Services. Labels are not necessarily unique. Objects could carry the same set of labels.

Label selectors are used to query objects with labels of the following types:

  • Equality-based:
    • Use equal (= or ==) or not-equal (!=) operators
  • Set-based:
    • Use in or notin operators

Getting ready

Before you get to setting labels in the objects, you should consider the valid naming convention of key and value.

A valid key should follow these rules:

  • A name with an optional prefix, separated by a slash.
  • A prefix must be...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at AU $24.99/month. Cancel anytime