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
  • Introduction
  • Parameters in Service Definition
  • Modifying a component in a service
  • Note:
Export as PDF
  1. Key Concepts
  2. Service

Know Your Service Definition

PreviousServiceNextVersioning

Last updated 2 years ago

Introduction

A service is an atomic unit of deployment. It is meant to package a business functionality as a unit, though, the user can define it as per their use case. A service is composed of multiple components. In this article, we are going to discuss the details of the service definition that can be used in Odin. Following will be the items covered here:

  1. Parameters in Service definition

  2. How to add a new component in the service

  3. Modify a component in a service

  4. Route 53 creation using Odin

Parameters in Service Definition

While defining a service there are couple of mandatory fields that we have to include. A service can be uniquely identified with its name and version. Hence, name and versions are two mandatory fields along with team and components:

– Name: Name field is used to define the name of the service and the service will be identified with this name. E.g: In service definition, the service can be identified with the name “MyAuth“.

– Version: Version field is used to define the service version you are deploying. E.g: In service definition, the version of the service is “1.0.0“.

– Team: Team field is used to define the team name that owns the service. E.g: In service definition, the team name of the service is “tech“.

– Components: Your service needs a certain set of components to successfully run the service. This is where we define the set of components, their versions needed for the service, and other mandatory parameters needed for the components to be successfully operational. E.g: In service definition, the service MyAuth needs three components to successfully operate - “application“, “cassandra“, and “aerospike“.

– Artifact name & version: A component details should be having the artifact name and the version for the same. The artifact name and versions may or may not be same as component name and versions respectively. It is highly recommended to provide the details in service definition though these are optional fields. In case you are not providing these details, Odin will assume that the artifact name and version are same as that of the component. E.g: In service definition, for the component application, artifact name and version have been provided as part of the application config which are test and 1.0.0 respectively.

How to add a new component in a service

There might be situations when your service needs a new component and the same needs to be added in the service definition. We can follow the below steps to add a new component to the service definition:

odin list component-type 
odin describe component-type --name COMPONENT_NAME
  • Once we have the list of exposed components, we can see the exposed configs for the particular components. For example, following are the list of configs which can be altered for the component S3. In the second column, we can see if that particular configuration is mandatory or optional to include in your service definition.

List of exposed configs :

  CONFIG               | MANDATORY | DATA TYPE  
-----------------------+-----------+------------
  config.access        | false     | string     
  config.bucket_name   | true      | string     
  config.force_destroy | false     | string     
  config.versioning    | false     | string     
  name                 | true      | string     
  type                 | true      | string     
  version              | true      | string   
  • Include one more block within the components section of the service definition and change the mandatory configs within the same in the following manner. The service definition will now start deploying the new component as well.

"components": [
    {
      "type": "s3",
      "name": "new-components",
      "version": "1.0.0",
      "config":{
      "artifact_name": "arc_s3",
      "artifact_version": "1.0.0.1",
      "versioning": "PROVIDE VERSIONING",
      "force_destroy" : "PROVIDE VALUES"
      }
    },

Modifying a component in a service

As part of service definition, one can change the component configuration. However, the same is limited to the configs which are exposed as part of component definition. E.g: as mentioned in the above segment, some of the exposed configs for s3 component are access, bucket_name, versioning etc. One can alter these configs and modify the component configuration within a service definition.

Please note, given a change in component definition within the service is altering the service definition, you need to update the service version to the next version compared to its current.

________________________________________________________________________________________________

Note:

Customise Route53 using Odin

Route 53 is created in Odin by default as part of its behaviour. As an Odin user, one can alter the route 53 configuration. Route is part of your application component. The process is very similar to modifying a component in a service. To illustrate, please follow the below steps:

  • To view the application definition, use the following command to see the exposed configs:

odin describe component-type --name application
  • Once you type the above command, the following table is going to be a part of the output. As you can see, route is a configurable exposed configs:

List of exposed configs :

  CONFIG                    | MANDATORY | DATA TYPE  
----------------------------+-----------+------------
  config.artifact_name      | false     | string     
  config.artifact_version   | false     | string     
  config.build_type         | true      | string     
  config.build_version      | true      | string     
  config.discovery          | false     | string     
  config.liveness_endpoint  | false     | string     
  config.loadbalancer-type  | false     | string     
  config.port               | false     | integer    
  config.readiness_endpoint | false     | string     
  config.route.private      | false     | string     
  config.route.public       | false     | string     
  default.deployment_type   | false     | string     
  dev.deployment_type       | false     | string     
  load.deployment_type      | false     | string     
  load.params.instance_type | false     | string     
  load.params.lb_type       | false     | string     
  name                      | true      | string     
  type                      | true      | string     
  version                   | true      | string  
  • Next, go to your service definition and in the component type application under the config section, add the route configuration. You can use TEAM_SUFFIX and VPC_SUFFIX in the route53, these variables will be replaced at runtime.

"components": [
    {
      "type": "application",
      "name": "profile",
      "version": "1.0.0-QA-SNAPSHOT",
      "config": {
        "artifact_name": "test",
        "artifact_version": "1.0.0",
        "build_type": "java",
        "build_version": "8"
        "route":{
          "private": "profile-app$TEAM_SUFFIX.dream11$VPC_SUFFIX.local"
        }
      }
    }

Verify if the new component you are trying to add is supported by Odin by using the following command. If you do not see your component in the list, please reach out to us .

If your component type is supported by Odin, use the following command to view the component description. With the component description, we can see the configurations for the components that one can override. For example, see the sample component definition for S3 here - .

this
this
this
this
this
@dss_odin_feedback
S3 Component Definition