Skip to main content

Deployment Options

NanoBus is able to run in almost any type of deployment environment.

Binary

nanobus run <OCI Package Reference or Path to bus.yaml>

Docker

docker run -it -p 8080:8080 -v $(pwd):/app/ nanobus/nanobus:latest run <OCI Package Reference or Path to bus.yaml>

Docker Compose

version: "3"

services:
nanobus:
image: nanobus/nanobus:latest
args:
- "run"
- <OCI Package Reference or Path to bus.yaml>
volumes:
- ./:/app/
ports:
- "8080:8080"

Kubernetes

apiVersion: apps/v1
kind: Deployment
metadata:
name: candle-site
namespace: candle-site
spec:
selector:
matchLabels:
app: candle-site
replicas: 2
template:
metadata:
labels:
app: candle-site
spec:
nodeSelector:
agentpool: platpool
containers:
- name: candle-site
resources:
limits:
memory: "128Mi"
cpu: "500m"
image: nanobus/nanobus:v0.0.16
args:
- "run"
- "reg.candle.run/candlecorp/candle-site:0.0.0"
imagePullPolicy: Always
ports:
- containerPort: 8080
#The following is only needed if you are trying to download from a private project/org on your registry.
volumeMounts:
- mountPath: /.docker/config.json
name: docker-config
subPath: .dockerconfigjson
volumes:
- name: docker-config
secret:
secretName: registry-secret #created using "kubectl create secret docker-registry"

Nomad

In Nomad, it can be run as a container or as an exec job.

Nomad - Docker

job "nanobus" {
datacenters = ["dc1"]
type = "service"

task "nanobus" {
driver = "docker"
config {
image = "nanobus/nanobus:latest"
args = ["run","<OCI Package Reference or Path to bus.yaml>"]
}

ports {
http = 8080
}

resources {
cpu = 100
memory = 128
}
}
}

Nomad - Exec

job "nanobus" {
datacenters = ["dc1"]
type = "service"

task "nanobus" {
driver = "exec"
config {
command = "/path/to/nanobus"
args = ["run", "<OCI Package Reference or Path to bus.yaml>"]
}

ports {
http = 8080
}

resources {
cpu = 100
memory = 128
}
}
}