Skip to content

Compact PaaS - PoC small based golang app PaaS closed in one container

License

Notifications You must be signed in to change notification settings

eBayClassifiedsGroup/KomPaaS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

KomPaaS

Compact PaaS - PoC - playgroud mode - small based golang app PaaS closed in one container

Watch Kelsey Hightower demo Consul, Nomad, Vault and fabio at HashiConf EU 2016.

  • Requirements:

    • docker 1.9 or higher
    • docker pull python:alpine #(only for an example)
  • Components:

    • Nomad
    • Consul
    • Fabio
    • Nomad-ui jippi version (with docker-compose only)
  • Most important ports:

service port
Consul UI 8500
Fabio UI 9998
Nomad UI 3000
Fabio router 9999

Build image or get it

$ ./build.it

or

$ docker pull kompaas/kompaas

Usage:

interactive:

(tmux knowledge required)

$ docker run \
  --net=host \
  --privileged \
  --volume "/var/run/docker.sock:/var/run/docker.sock" \
  --volume "/tmp:/tmp" \
  -ti kompaas/kompaas tmux attach

docker compose:

$ docker-compose up -d
Creating kompaas_consul_1
Creating kompaas_nomad_1
Creating kompaas_fabio_1
Creating kompaas_nui_1

Start example

if you run tmux:

$ nomad run example.nomad

else:

$ docker exec -ti kompaas_nomad_1 nomad run example.nomad
==> Monitoring evaluation "cbbea755"
    Evaluation triggered by job "example"
    Allocation "b00798bf" created: node "4522e2f4", group "python"
    Allocation "64a73a0f" created: node "4522e2f4", group "python"
    Allocation "669afa7b" created: node "4522e2f4", group "python"
    Allocation "80de4c42" created: node "4522e2f4", group "python"
    Evaluation status changed: "pending" -> "complete"
==> Evaluation "cbbea755" finished with status "complete"

$ docker ps
CONTAINER ID        IMAGE                    COMMAND                  CREATED             STATUS              PORTS                                                  NAMES
5920ecba205e        python:alpine            "/bin/sh -c 'echo $HO"   7 seconds ago       Up 6 seconds        127.0.0.1:31873->8000/tcp, 127.0.0.1:31873->8000/udp   server-64a73a0f-5999-fcc2-6aa6-b1cf228d1b74
91a51e1ced32        python:alpine            "/bin/sh -c 'echo $HO"   7 seconds ago       Up 6 seconds        127.0.0.1:42008->8000/tcp, 127.0.0.1:42008->8000/udp   server-80de4c42-4786-2c09-40c9-69002c7f79b4
f1ea7b8984ef        python:alpine            "/bin/sh -c 'echo $HO"   7 seconds ago       Up 6 seconds        127.0.0.1:28821->8000/tcp, 127.0.0.1:28821->8000/udp   server-b00798bf-8b32-c40a-a5fb-6496c7112748
66df4804ee1e        python:alpine            "/bin/sh -c 'echo $HO"   7 seconds ago       Up 6 seconds        127.0.0.1:55579->8000/tcp, 127.0.0.1:55579->8000/udp   server-669afa7b-8f33-9dbd-0f21-c83ccf369485
557511c14cf5        kompaas/kompaas          "fabio"                  17 seconds ago      Up 16 seconds                                                              kompaas_fabio_1
b538488d26ac        kompaas/kompaas          "consul agent -client"   17 seconds ago      Up 16 seconds                                                              kompaas_consul_1
0f643244ef92        kompaas/kompaas          "nomad agent -dev"       17 seconds ago      Up 16 seconds                                                              kompaas_nomad_1
e30d12884ce5        jippi/nomad-ui   "apache2-foreground"     17 seconds ago      Up 16 seconds                                                              kompaas_nui_1

Test example

$ while true; do
    curl -H 'Host: python.service.consul' http://localhost:9999
  done

About

Compact PaaS - PoC small based golang app PaaS closed in one container

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published