Skip to main content
Labels and annotations are key-value pairs that provide metadata for Kubernetes resources. This guide covers how to view, add, and manage labels and annotations through the Dashboard interface.

Overview

Kubernetes uses two types of metadata:

Labels

Identifying metadata used for selection and organization

Annotations

Non-identifying metadata for tools and libraries

Labels

Labels are key-value pairs attached to objects for identification and selection:
Use cases:
  • Resource selection via label selectors
  • Service discovery and routing
  • Organizing resources by application, environment, or team
  • Scheduling and placement decisions

Annotations

Annotations store arbitrary non-identifying metadata:
Use cases:
  • Build/release information
  • Tool configuration (monitoring, logging, service mesh)
  • Documentation and contact information
  • Deployment history and rollout tracking

Viewing Labels and Annotations

In List Views

Resource list views display common labels:
  1. Navigate to any resource type (Pods, Deployments, Services, etc.)
  2. Labels are shown in the list view columns
  3. Click on a label to filter resources with that label

In Detail Views

View all labels and annotations for a resource:
1

Open Resource

Click on any resource name to open its detail view
2

View Metadata Section

Scroll to the metadata section showing labels and annotations
3

Expand Lists

Click to expand the full list of labels or annotations

In YAML View

See the raw metadata:
  1. Open resource detail view
  2. Click the YAML tab
  3. Find the metadata section:

Adding Labels

Add labels through the Dashboard UI:

During Resource Creation

When creating applications via the form:
1

Access Creation Form

Navigate to CreateCreate from form
2

Show Advanced Options

Expand the advanced options section
3

Add Labels

In the labels section, click Add Label
4

Enter Key-Value Pairs

Provide label key and value:
Dashboard automatically adds the k8s-app label to deployments created via the form. This label is used for service discovery and dashboard organization.

Editing Existing Resources

Add labels to existing resources:
1

Open Resource

Navigate to the resource detail view
2

Edit YAML

Click the Edit button
3

Add Labels

Update the metadata.labels section:
4

Save Changes

Click Update to apply changes

Adding Annotations

Add annotations for documentation and tool integration:

Via YAML Editor

Common Annotations

Label Selectors

Use label selectors to filter and organize resources:

Equality-Based Selectors

Match labels exactly:
This matches resources with both labels.

Set-Based Selectors

More flexible matching:
Operators:
  • In: Label value is in the set
  • NotIn: Label value is not in the set
  • Exists: Label key exists
  • DoesNotExist: Label key doesn’t exist

Using Selectors in Dashboard

Filter resources by labels:
  1. Navigate to any resource list view
  2. Click a label value in the list
  3. Dashboard filters to show only resources with that label

Label Best Practices

Structure labels for clarity:
Good:
Avoid:
Standardize across your organization:
Annotations are limited to 256KB total. For large data, use ConfigMaps or external storage.

Common Label Patterns

Application Identification

Environment Segregation

Team Ownership

Release Tracking

Cost Allocation

Service Discovery with Labels

Services use label selectors to find pods:
Dashboard displays the label selector in the service detail view, showing which pods are selected by the service.

Deployment Selectors

Deployments use selectors to manage pods:
Deployment selectors are immutable after creation. You cannot change the selector without deleting and recreating the deployment.

Label Validation

Labels must follow specific rules:

Label Keys

  • Optional prefix + name separated by /
  • Prefix: DNS subdomain (max 253 characters)
  • Name: max 63 characters
  • Characters: alphanumeric, -, _, .
  • Must start and end with alphanumeric
Valid:
Invalid:

Label Values

  • Max 63 characters
  • Can be empty
  • Characters: alphanumeric, -, _, .
  • Must start and end with alphanumeric (if non-empty)

Troubleshooting

Dashboard shows a limited set of common labels in list views. View the full list in the detail view or YAML tab.
Deployment selectors are immutable. You must delete and recreate the deployment with a new selector.
Verify the service selector matches pod labels:
Ensure labels follow naming conventions:
  • Max 63 characters for name
  • Alphanumeric, -, _, . only
  • Start and end with alphanumeric

Next Steps

Managing Resources

Learn about resource management

Managing Applications

Deploy and manage applications