Know Your Service Definition
Last updated
Last updated
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:
Parameters in Service definition
How to add a new component in the service
Modify a component in a service
Route 53 creation using Odin
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:
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.
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.
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.
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:
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:
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.
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 - .