Skip to content

tyrelh/cube-orchestrator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cube Orchestrator

This repo is me following along to the book Build an Orchestrator in Go by Tim Boring.

It's a simplistic implementation of an orchestrator, like Kubernetes, written in Go using Docker.

Setup

You'll need Go installed as well as Docker.

go mod install

Run

To run the service and API:

CUBE_WORKER_HOST=localhost \
CUBE_WORKER_PORT=5556 \
CUBE_MANAGER_HOST=localhost \
CUBE_MANAGER_PORT=5555 \
go run .

Sample API requests

List tasks

curl -s localhost:5555/tasks | jq

Create task

curl -s --request POST \
    --header 'Content-Type: application/json' \
    --data '{"ID":"266592cd-960d-4091-981c-8c25c44b1018","State":2,"Task":{"State":1,"ID":"266592cd-960d-4091-981c-8c25c44b1018","Name":"test-chapter-5-1","Image":"timboring/echo-server:latest"}}' \
    localhost:5555/tasks | jq
curl -s --request POST localhost:5555/tasks -d @sample_task.json | jq

Delete task

curl -s --request DELETE "localhost:5555/tasks/266592cd-960d-4091-981c-8c25c44b1018" | jq

Get stats

curl -s localhost:5555/stats | jq

About

Cube container orchestrator written in Go w/Docker

Resources

Stars

Watchers

Forks

Contributors

Languages