Core Concepts
Labels

Target Labels

Target labels in Ctrlplane are key-value pairs that provide a flexible way to categorize and organize your deployment targets. They play a crucial role in defining deployment strategies, filtering targets, and applying configurations selectively.

Understanding Target Labels

Labels are metadata attached to targets, allowing you to group and select targets based on various criteria. They are particularly useful for:

  • Organizing targets by environment, region, or purpose
  • Applying configurations to specific groups of targets
  • Filtering targets for deployment or management tasks
  • Applying variable values to specific targets during deployment

How Labels Work in Ctrlplane

  1. Definition: Labels are defined as key-value pairs on individual targets.
  2. Flexibility: You can assign multiple labels to a single target.
  3. Querying: Ctrlplane allows you to query and filter targets based on their labels.
  4. Selective Application: Use labels to apply configurations or run deployments on specific subsets of targets.

Examples of Target Labels

Here are some common examples of how you might use labels in Ctrlplane:

environment: production
region: us-west
role: web-server
tier: frontend
---
environment: staging
region: eu-central
role: database
tier: backend

Best Practices for Using Labels

  1. Consistency: Establish a consistent labeling scheme across your organization.
  2. Granularity: Use labels that provide the right level of detail for your needs.
  3. Documentation: Maintain clear documentation of your label taxonomy.
  4. Avoid Overloading: Don't try to encode too much information in a single label.
  5. Regular Review: Periodically review and update your labeling strategy as your infrastructure evolves.

By effectively using target labels in Ctrlplane, you can create more flexible, manageable, and scalable deployment strategies that adapt to your organization's evolving needs.

Special Labels

In Ctrlplane, we have special labels that can be added to targets to enhance the user experience in the UI. These labels do not change the core functionality of Ctrlplane but provide additional features and visual cues for better usability.

LabelDescription
ctrlplane/linksProvides a set of links related to the target. The value should be a JSON object where the keys are the link names and the values are the URLs.
ctrlplane/created-by-job-idUUID of the Ctrlplane Job that created the target.
ctrlplane/external-idAn external identifier for the target, which can be used to correlate the target with resources in other systems.
ctrlplane/cloud-platformThe cloud platform the target is running on (e.g., AWS, GCP, Azure).
ctrlplane/regionThe geographical region or data center location where the target is deployed.
ctrlplane/parent-target-idThe UUID of the parent target, if the target is a child resource of another target.
Ctrlplane
© 2024 Ctrlplane. All rights reserved.