Labels & Annotations
After filling in details regarding Access level, Resource Quota, Configurations, Secrets & PVC, Environment Variables, Node & Service Affinity and Liveness & Readiness, you can also specify Labels and Annotations. Providing information regarding Labels and Annotations is not mandatory. It is completely optional to fill in details for this section.
Labels and annotations are two important concepts in Kubernetes that allow developers and administrators to organize, select, and annotate(add details) objects in a containerized environment.
#
What are Labels?Labels are key-value pairs that you can attach to Kubernetes objects, such as pods, services, or deployments, to organize and select them. You can use labels to categorize objects based on their characteristics, such as their role, environment, or version.
For example, you can add a "tier" label to differentiate between the frontend and backend components of an application or a "release" label to indicate the version of the application.
#
What are Annotations?Annotations are also key-value pairs that you can attach to Kubernetes objects, but for a different purpose. Annotations provide additional metadata that you can use to describe and annotate objects, such as who created the object, when it was created, or any other relevant information. They are often used to store additional information about an object that is not captured in its labels or other fields.
For instance, annotations can be used to store non-identifying information, such as build or release numbers, monitoring data, manifest file or other notes.
The key difference between labels and annotations is that labels are used for selecting and grouping objects, while annotations are used for adding additional information or metadata to objects.
#
Set LabelsHere’s how you can set Labels using to categorize and identify Kubernetes objects.
- Click “Yes” to set Labels else click “No”.
- Choose "Field View"or switch to "Editor View"" depending on the number of variables you need to manage.
#
Set Labels using Field ViewYou can use Field View to manage a small number of variables.
- Enter the Key and Value.
- Click “Add Row” to add more key-value pairs.
#
Set Labels using Editor ViewYou can Switch to Editor View in case you want to copy-paste or manage a large number of variables
- Copy and paste the key-value pairs.
#
Set AnnotationsHere’s how you can set Annotations to add more details regarding Kubernetes objects.
- Click “Yes” to set Annotations else click “No”.
- Choose "Field View"or switch to "Editor View"" depending on the number of variables you need to manage.
#
Set Annotations using Field ViewYou can use Field View to manage a small number of variables.
- Enter the Key and Value.
- Click “Add Row” to add more key-value pairs.
#
Set Annotations using Editor ViewYou can Switch to Editor View in case you want to copy-paste or manage a large number of variables
- Copy and paste the key-value pairs.