Labels && Selectors && annotations


Labels —————> used for grouping objects together

unique objects.

Dictionary of items

How to identify labels ?

on metadata section on yaml file

metadata:

labels:

key: value

key1: value2


Selectors ——————→ filter objects

How to use selector ?

$ kubectl get pods —selector key=value

How many objects are in the prod environment including PODs, ReplicaSets and any other objects?

if We have more than one selector ?

$ kubectl get pods --selector env=prod,tier=frontend,bu=finance


Annotations —————> used to record information

EX ————> build version , email , phone numbers

`How to identify annotations ?

metadata:

labels:

annotations:

buildVersion: 1.67