Public | Automated Build

Last pushed: 2 years ago
Short Description
alpha of kDaemon
Full Description

Klouds Cluster Daemon

Version 0.0

<img src="" align="center"/>

A RESTful API framework for managing containers over a set of Docker Nodes running Prometheus as a monitoring solution.
Will also run a watcher process that will monitor, fix and/or notify administration on the state of the cluster.

##WEB UI -- MOVED to new REPO

The user interface currently included has no functionality and is rather ugly. New UI is being built at


with the websocket being served at /ws


* Make daemon aware of new docker/prometheus endpoints (adding nodes to the cluster)
* Launch containers on the cluster (use prometheus to loadbalance and schedule jobs)
* Forward container access information to Consul for loadbalancing endpoints through a reverse proxy (such as HAProxy or Nginx)

Full stack design can be read here
Development Plan and here
Daemon Design


    docker-prometheus --\    /---> consul ---> haproxy-consul  <--\
                            \    /                                       \
    docker-prometheus --->kDaemon -><-- klouds-frontend <----------User
    docker-prometheus __/

###Configuration -- config/app.conf

    bind_ip =               # IP to bind API to
    api_port = 1337                    # Port to bind API to
    rethinkdb_host =        # RethinkDB Host
    rethinkdb_port = 28015            # RethinkDB Port
    rethinkdb_dbname = kdaemon      # RethinkDB database name


  • Your nodes need to be running the docker API
  • Rethinkdb with database name of rethinkdb_dbname and tables

    • containers
    • nodes
    • applications

      (will be creating tables if they don't exist in the future, not implemented at the moment though)

###To build (linux):

    go get
    cd $GOPATH/src/
    go build .

To Run



For development, it is okay to publicly expose your docker endpoints with

    docker -H -H unix:///var/run/docker.sock -d &

If attempting to deploy in production, you will want to point your docker hosts into a VPN and have kDaemon linked through this VPN. We suggest using Weave. Support for Docker authentication is in the pipeline though you should use VPNs regardless.

####Adding a node

To add a node, you can POST to bind_ip:api_port/%API_VERSION%/node/create

        "d_port": "2375",

####Adding an application

To add an application, you can POST to bind_ip:api_port/%API_VERSION%/application/create

        "docker_image": "ghost",

####Launching a container

To launch a container on your most available node, you can POST to bind_ip:api_port/%API_VERSION%/container/create


ENDPOINTS [X] = Not implemented

 * POST /%API_VERSION%/node/create              -- Creates a node
 * PUT /%API_VERSION%/nodes/update                  -- Edits a node
 * DELETE /%API_VERSION%/nodes/delete              -- Deletes a node
 * GET /%API_VERSION%/nodes/:id                  -- Gets node information
 * GET /%API_VERSION%/nodes                      -- Gets all nodes

 * POST /%API_VERSION%/application/create          -- Creates an application in the database
 * PUT /%API_VERSION%/applications/update          -- Edits an application
 * DELETE /%API_VERSION%/applications/delete      -- Deletes an application
 * GET /%API_VERSION%/applications/:id          -- Gets application information
 * GET /%API_VERSION%/applications              -- Gets all applications

 * POST /%API_VERSION%/container/create          -- Creates a container on the cluster
 * PUT /%API_VERSION%/containers/update          -- Edits a container [X]
 * DELETE /%API_VERSION%/containers/delete      -- Deletes a container [X]
 * GET /%API_VERSION%/containers/:id              -- Gets container information
 * GET /%API_VERSION%/containers                  -- Gets all containers

 * POST /%API_VERSION%/user/create              -- Creates a user [X]
 * PUT /%API_VERSION%/users/update              -- Edits a users [X]
 * DELETE /%API_VERSION%/users/delete              -- Deletes a user [X]
 * GET /%API_VERSION%/users/:id                  -- Gets user information [X]

Main Contributor Ozzadar

Docker Pull Command
Source Repository