-
Notifications
You must be signed in to change notification settings - Fork 0
Using Odin
In order to use Odin and to work on your environments, you first need to install Odin. For that,
export HOMEBREW_GITHUB_API_TOKEN=<your github access token>
brew install dream11/tools/odin
Or, if you need a development setup and want to add/fix the features,
-
Download and run the Go
1.17
installer. - Verify Go:
go version
- Clone this repo:
git clone https://github.com/dream11/odin
- Enter the repository:
cd odin
- Install dependencies:
go mod download
- Verify the cli:
go run main.go --version
Post this,
- Use
make install
to compile, package and install the code as a running executable on your system.
Each command is formed of 2 resources, a verb
and a resource
, which are further assisted by a few command-specific and some generic options.
odin
[--version]
[--help]
<command>
[<options>]
command → verb
+ resource
A verb simply denotes any action that can be performed.
Supported verbs -
- Create - To create/register a new resource record.
- Update - To update an existing resource record.
- Delete - To delete/deregister an existing resource record.
- Describe - To describe an existing resource record.
- Label - To label/mark an existing resource record.
- List - To list a number of existing resource records.
- Status - To fetch the current status of a resource.
- Logs - To fetch the logs of a resource execution.
- Deploy - To deploy the resource record to form a functional unit.
- Undeploy - To undeploy the resource record to form a functional unit.
- Destroy - To destroy the deployed functional unit of a resource.
- GetHistory - To get a changelog of resources.
- DescribeHistory - To describe a changelog of resources.
A resource is an entity on which the verbs are performed.
This is the type of component, that can be attached to a service.
Verbs & Options -
-
Verb: list, Options:
--name
&--version
, Example:odin list component-type --name=rds --version=1.0.0
-
Verb: describe, Options:
--name
&--version
, Example:odin describe component-type --name=rds --version=1.0.0
A component is the smallest individual entity in the framework, which represents an actual deployable unit, like - databases and application resources
This is a logical boundary around stateless and stateful components that together form a functional entity capable to handle some business logic. Example: fantasy-tour
service comprises fantasy-tour
& fantasy-tour-admin
applications and aerospike
& redis
datastores.
Verbs & Options -
-
Verb: create, Options:
--file
, Example:odin create service --file=fantasy-tour.yaml
-
Verb: delete, Options:
--name
,--version
&--component
, Example:odin delete service --name=fantasy-tour --version=1.0.0
-
Verb: describe, Options:
--name
,--version
&--component
, Example:odin describe service --name=fantasy-tour --version=1.0.0 --component=aerospike
-
Verb: label, Options:
--name
,--version
&--mature
, Example:odin label service --name=fantasy-tour --version=1.0.0 --mature
-
Verb: list, Options:
--team
,--version
,--mature
&--detailed
, Example:odin list service --team=coreinfra --version=1.0.0 --mature --detailed
-
Verb: deploy, Options:
--name
,--version
,--force
,--rebuild
&--env
, Example:odin deploy service --name=fantasy-tour --version=1.0.0 --env=demo-1234 --force --rebuild
-
Verb: undeploy, Options:
--name
&--env
, Example:odin undeploy service --name=fantasy-tour --env=demo-1234
-
Verb: status, Options:
--name
&--version
, Example:odin status service --name=fantasy-tour --version=1.0.0
This is a set of infrastructural components that are required to deploy the components of a service.
Verbs & Options -
-
Verb: create, Options:
--team
,--purpose
,--env-type
&--account
, Example:odin create env --team=coreinfra --purpose=demo --env-type=kube
-
Verb: update, Options:
--name
&--file
, Example:odin update env --name=kube-1234 --file=config.json
-
Verb: status, Options:
--name
&--service
, Example:odin status env --name=demo-1234 --service=fantasy-tour
-
Verb: delete, Options:
--name
, Example:odin delete env --name=kube-1234
-
Verb: describe, Options:
--name
,--service
&--component
, Example:odin describe env --name=kube-1234 --service --component
-
Verb: list, Options:
--name
,--team
,--env-type
&--account
, Example:odin list env --name=demo-1234 --team=coreinfra --env-type=stag --account=revenue
-
Verb: get-history, Options:
--name
, Example:odin get-history env --name=demo-1234
-
Verb: describe-history, Options:
--name
&--id
, Example:odin describe-history --name=demo-1234 --id=1
This is a unique resource that itself is a verb but doesn't apply to any resource and acts as a fully-fledged command.
Verbs & Options -
-
Verb: configure, Options:
--refresh
&--hard
, Example:odin configure --refresh --hard
For more, visit confluence.