Skip to content

Deploy Your First Service

This guide walks you through deploying your first service with Odin, from installation to verification.

  • Odin CLI installed (Installation Guide)
  • Access to an Odin backend
  • Cloud provider account configured

First, configure Odin with your backend:

Terminal window
odin configure \
--backend-address api.odin.example.com:443 \
--org-id 12345

This will:

  1. Prompt for authentication
  2. Store credentials in ~/.odin/config
  3. Set up the default profile

Create a development environment:

Terminal window
odin create env dev --accounts aws/dev-account

Verify the environment was created:

Terminal window
odin list env

Create a file named service.json:

service.json
{
"name": "hello-world",
"version": "1.0.0-SNAPSHOT",
"team": "platform",
"components": [
{
"name": "web",
"type": "webservice",
"version": "1.0.0",
"config": {
"port": 8080,
"replicas": 2
}
}
]
}

This defines a simple web service with 2 replicas.

Create a file named provisioning.json:

provisioning.json
[
{
"component_name": "web",
"deployment_type": "kubernetes-deployment",
"params": {
"namespace": "dev",
"cpu": "100m",
"memory": "256Mi",
"replicas": 2,
"image": "nginx:latest",
"port": 8080,
"service_type": "LoadBalancer"
},
"env_variables": {
"ENVIRONMENT": "development"
}
}
]

This specifies how to deploy the web component to Kubernetes.

Deploy the service to your dev environment:

Terminal window
odin deploy service --env dev \
--file service.json \
--provisioning provisioning.json

You’ll see output showing the deployment progress:

Deploying service hello-world (1.0.0-SNAPSHOT) to environment dev...
Components:
✓ web: DEPLOYING
Deployment started. Use 'odin status env dev --service hello-world' to check progress.

Monitor the deployment:

Terminal window
odin status env dev --service hello-world

Output:

Service: hello-world
Version: 1.0.0-SNAPSHOT
Status: DEPLOYED
Components:
┌──────┬───────┬──────────┬──────────┐
│ Name │ Type │ Status │ Ready │
├──────┼───────┼──────────┼──────────┤
│ web │ web │ DEPLOYED │ 2/2 │
└──────┴───────┴──────────┴──────────┘

Get detailed information about the deployment:

Terminal window
odin describe env dev --service hello-world --component web

This shows:

  • Component configuration
  • Resource allocation
  • Endpoints and URLs
  • Recent events

If deployed to Kubernetes, you can access it:

Terminal window
# Get the service URL
kubectl get svc -n dev
# Access the service
curl http://<load-balancer-url>

Congratulations! You’ve deployed your first service with Odin. Now you can:

Error: authentication failed

Solution: Run odin configure again and ensure your credentials are correct.

Error: environment 'dev' not found

Solution: Create the environment first with odin create env dev --accounts <account>.

Error: deployment timed out

Solution: Check the logs with odin describe env dev --service hello-world and verify your provisioning config.

To remove the service:

Terminal window
odin undeploy service hello-world --env dev

To delete the environment:

Terminal window
odin delete env dev