bsdpot / nomad-pot-driver

Nomad task driver for launching freebsd jails.
Apache License 2.0
85 stars 14 forks source link

Pot task Driver

Name: pot-task-driver

The Pot task driver provides an interface for using pot for dynamically running applications inside a FreeBSD Jail. You can download the external pot-task-driver here.

This version of the driver requires pot 0.15.0 or greater.

Complete job example

job "example" {
  datacenters = ["datacenter"]
  type        = "service"

  group "group1" {
    count = 1

    task "www1" {
      driver = "pot"

      service {
        tags = ["nginx", "www"]
        name = "nginx-example-service"
        port = "http"

         check {
            type     = "tcp"
            name     = "tcp"
            interval = "60s"
            timeout  = "30s"
          }
      }

      config {
        image = "https://potluck.honeyguide.net/nginx-nomad"
        pot = "nginx-nomad-amd64-13_1"
        tag = "1.1.13"
        command = "nginx"
        args = ["-g","'daemon off;'"]

        copy = [
          "/mnt/s3/web/nginx.conf:/usr/local/etc/nginx/nginx.conf",
        ]
        mount = [
          "/mnt/s3/web/www:/mnt"
        ]
        port_map = {
          http = "80"
        }
      }

      resources {
        cpu = 200
        memory = 64

        network {
          mbits = 10
          port "http" {}
        }
      }
    }
  }
}

Task Configuration

task "nginx-pot" {
    driver = "pot"

    config {
      image = "https://potluck.honeyguide.net/nginx-nomad"
      pot = "nginx-nomad-amd64-13_1"
      tag = "1.1.13"
      command = "nginx"
      args = ["-g","'daemon off;'"]

      copy = [
        "/mnt/s3/web/nginx.conf:/usr/local/etc/nginx/nginx.conf",
      ]
      mount = [
        "/mnt/s3/web/www:/mnt"
      ]
      port_map = {
        http = "80"
      }
    }
}

The pot task driver supports the following parameters:

Client Requirements

pot-task-driver requires the following:

nomad_user="root"
nomad_env="PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/sbin:/bin"