Odin
  • Introduction
  • Why Odin?
  • Key Concepts
    • Environment
      • Environment Type
    • Provisioning
      • Provisioning Config for Component Types
    • Component
      • Available Component Types
      • Component Type reference
        • Optimus Components
          • Aerospike [6.3.0.7-1.0.0]
    • Service
      • Know Your Service Definition
    • Versioning
      • Clearing the Confusion: A Simplified Guide to Artifact, Component, and Service Versions
    • Service Sets
    • Labels
  • Reference
    • CLI reference
  • Onboard Your Service
    • Installation
    • Configure
    • Odin -h
    • Getting Started
    • Create Environment
      • Operations on Environment
    • Service Definition
    • Provisioning Config
    • Deploy Service
    • Release Service
    • Optimus Datastore Operations
      • How to use Optimus Datastore in my service?
      • RDS Operations
      • Aerospike Operations
      • Kafka Operations
    • Operating Service & Components
      • Redeploy
        • In Place Deployment
        • Blue Green Deployment
      • Rolling Restart
      • Adding & removing components
      • Revert a deployment for application component
      • Downscaling a Passive Stack
      • Updating the no. of stacks of application component
    • Dev <> QA iteration
    • Frequently Asked Questions
    • Deploy Concrete Service
    • Undeploy Service
    • Delete Environment
    • Appendix
  • How To
    • Define error threshold for canary deployment
    • Add or Remove a component in an already deployed service
    • Integrate mono-repo(cronjobs) with Odin
    • Deploy crontab with Odin
    • Integrate Data pipeline with Odin
    • Push logs to log central
    • Build artifacts for multi module applications
    • Load test with Odin
    • Track Deployments against Commit Ids
    • Deploy Service on Production - Dream11
    • How and when images are created
    • Check logs for deployed infrastructure - Dream11
    • Onboard Stepfunction as a component
    • Onboard Serverless as a component
    • Login to Kubernetes clusters
  • Release Notes
    • 1.2.0-beta.2 - 11 August, 2022
    • Odin October Release
    • Odin 1.2.0 - Nov 9th 2022
    • Odin February Release
Powered by GitBook
On this page
Export as PDF
  1. Key Concepts

Labels

This article is covering the details about labels, how it is created, how to add a label and why to use a label.

Introduction

Odin provides versioning for service for better control and maintainability. However, sometimes it can become cumbersome to remember all the versions in an environment and identify which version is used where. Labels are created to solve the above concern and provide better control over the versions.

What is a Label?

Labels are strings that can be used to point to a particular version of service in a particular environment. Labels can also be used interchangeably with versions.

E.g: In the staging environment, there are 5 versions [V1.0-V1.4] for a service amongst which only V1.4 is production ready. So the service owner or the team can add a label "production" to the V1.4. This will help the service owner and the team to identify the production equivalent version easily in stage without opening every version and going though the changes.

Mapping

Labels should have one-on-one mapping with the versions in an environment. This implies that only one version of a service can be mapped to a particular label in an environment. However, one particular service version in an environment can be mapped to multiple labels.

E.g: There is a service called Gameplay and has 5 versions available in staging V1.0.0-V1.0.4. Out of the five versions, only version V1.0.4 is production ready and rest are old versions. So V1.0.4 can be added with a label "Production". The "Production" label cannot be used with any other versions of the service gameplay in staging. However, version V1.0.4 can also be attached with a tag called "Latest" because that is the latest version of code available. So one version can have multiple tags but one tag can be mapped to only one version in an environment for a particular service.

Commands

To create a label as per the requirement, following command to be used:

#Creates a label with the name "latest"
odin create label --name latest

To add the created label "Latest" against the service "Profile" with version 1.0.0-SNAPSHOT, user can use the following command:

#Labels the version 1.0.0-SNAPSHOT of the service profile with a label "latest"
odin label service --name profile --version 1.0.0-SNAPSHOT --label latest

Similarly, the label can be removed from a particular version with the help of unlabel command as shown in below:

#Removes the label "latest" from the version 1.0.0-SNAPSHOT of the service profile
odin unlabel service --name profile --version 1.0.0-SNAPSHOT --label latest
PreviousService SetsNextCLI reference

Last updated 2 years ago