Skip to content

Latest commit

 

History

History
114 lines (88 loc) · 2.41 KB

README.md

File metadata and controls

114 lines (88 loc) · 2.41 KB

Skelly Logo Skeller

Skeller is a skeleton project for deploying services on a Consul/Nomad cluster.

Requirements

  • Vagrant
  • Ansible

Get Started

Clone the project

git clone https://github.com/awesome-algorand/skeller

Spin up the Vagrant cluster

vagrant up

View the services in your browser

Deploy a job using the admin url: http://localhost:4646/ui/jobs/run

job "lets-go" {
  datacenters = ["*"]
  group "servers" {
    count = 1
    network {
      port "www" {
        to = 8001
      }
    }
    service {
      provider = "consul"
      port     = "www"
    }
    task "web" {
      driver = "docker"
      config {
        image   = "busybox:1"
        command = "httpd"
        args    = ["-v", "-f", "-p", "${NOMAD_PORT_www}", "-h", "/local"]
        ports   = ["www"]
      }
      template {
        data        = <<-EOF
                      <h1>Hello, Nomad!</h1>
                      <ul>
                        <li>Task: {{env "NOMAD_TASK_NAME"}}</li>
                        <li>Group: {{env "NOMAD_GROUP_NAME"}}</li>
                        <li>Job: {{env "NOMAD_JOB_NAME"}}</li>
                        <li>Currently running on port: {{env "NOMAD_PORT_www"}}</li>
                      </ul>
                      EOF
        destination = "local/index.html"
      }
      resources {
        cpu    = 50
        memory = 64
      }
    }
  }
}

Production [WIP]

Orchestrator Cluster

The orchestrator is a Consul/Nomad cluster that will be used to manage the services.

Compute Cluster

The compute cluster is a group of machines that will be used to run the services. These services should be distributed across regions and availability zones.

Note

It is up to the user to provision the machines and provide the ssh configurations for ansible

Create an inventory file

# inventory.yaml
compute:
  hosts:
    us:
      ansible_host: [email protected]
      ansible_user: ubuntu
    eu:
      ansible_host: [email protected]
      ansible_user: ubuntu

Provision a machine

ansible-playbook -i inventory.yaml playbook.yaml 

TODO:

  • Production Deployment
  • Marketing Jazz
  • Terraform Plans