Component

Definition

A component is a process/bunch of processes that need to be executed as a unit. An example of a component is an application, cache, datastore. It is used as a building block in Services. Components cannot exist on their own; they exist only as a part of a service.

Every component is of a pre-defined type, which has default fields set. These fields can be optionally overridden(as and when they are whitelisted on the backend on a case-to-case basis).

Specification

Key
Value Type

type

string - all supported component types

name

string

version

string - all supported component versions

config

map - see config section for more info

Example

Below is a specification to define a component of type cassandra with version 3.11.8

{
    "type": "cassandra",
    "name": "foo-cassandra",
    "version": "3.11.8",
    "config": {
        ...CONFIG_FROM_DESCRIBE_COMMAND
    }
}

Example for application

{
    "type": "application",
    "name": "graphql",
    "version": "1.0.0",
    "config": {
        "build_type": "java",
        "build_version": "8",
        "port": 2000,
        "liveness_endpoint": "health",
        "readiness_endpoint": "health",
        "discovery": "both"
    }
}

Pro Tip

application component-type can be used for http application, crons , kafka-consumer

Supported Discovery Type

*Applicable only for component type application

Supported Discovery Type
Comment

public

service will be publicly available

private

available for internal discovery

both

open to both public and private network

none

used to disable discovery e.g. in case of kafka-consumer where the application is not discoverable

Available config for a component

Every component exposes config with options that can be accessed by.

odin describe component-type --name application
...component-defintion

List of exposed configs :

*Config*                  | *Mandatory* | *Data Type* |
config.build_type         | true        | string      |
config.build_version      | true        | string      |
config.discovery          | false       | string      |
config.liveness_endpoint  | false       | string      |
config.port               | false       | integer     |
config.readiness_endpoint | false       | string      |
name                      | true        | string      |
type                      | true        | string      |
version                   | true        | string      |

Read more about exposed configs here - Component Type reference

Last updated