Skip to content

Latest commit

 

History

History
122 lines (86 loc) · 2.94 KB

README.md

File metadata and controls

122 lines (86 loc) · 2.94 KB

README

Proof of Concept with Kong, Nomad, Consul on a Raspberry Pi.

Getting started

Dev on macOs

  1. Install Nomad and Consul

  2. Run the following Command.

Please note as of Nomad v0.12.5, Nomad's Connect integration requires Linux network namespaces. Nomad Connect will not run on macOS.

cd <repo>
nomad agent -dev -config=nomad.d
consul agent -dev -node=local -ui 

Dev on Vagrant

  1. Install Nomad, Consul and Vagrant

  2. Run the following commands.

cd <repo>
vagrant up
vagrant ssh
  1. Over SSH on the VM, run the following commands.
nomad agent -dev -bind=0.0.0.0 -config=/vagrant/nomad.d
consul agent -dev -node=local -ui --client=0.0.0.0

Production on Raspberry Pi

  1. Set up Nomad by following the officla deployment guide. Make sure you install the arm64 binary. Default URL of Nomad UI : http://HOST_IP:8500

The example systemd unit file is as below.

$ systemctl cat nomad.service

# /etc/systemd/system/nomad.service
[Unit]
Description=Nomad
Documentation=https://nomadproject.io/docs/
Wants=network-online.target
After=network-online.target

[Service]
ExecReload=/bin/kill -HUP $MAINPID
ExecStart=/usr/local/bin/nomad agent -config /home/ubuntu/doh.chriswang.tech/nomad.d
KillMode=process
KillSignal=SIGINT
LimitNOFILE=infinity
LimitNPROC=infinity
Restart=on-failure
RestartSec=2
StartLimitBurst=3
StartLimitIntervalSec=10
TasksMax=infinity

[Install]
WantedBy=multi-user.target
  1. Set up Consul by following the officla deployment guide. Make sure you install the arm64 binary. Default URL of Consul UI: http://HOST_IP:4646

The example systemd unit file is as below.

$systemctl cat consul.service

# /etc/systemd/system/consul.service
[Unit]
Description="Consul"
Documentation=https://www.consul.io/
Requires=network-online.target
After=network-online.target

[Service]
# The configuration provided by this tutorial is the recommended one for a Consul datacenter running multiple server nodes. In test environemnts or environments where only one Consul server is deployed you should>
Type=exec
#User=consul
#Group=consul
ExecStart=/usr/local/bin/consul agent -config-dir=/home/ubuntu/doh.chriswang.tech/consul.d
ExecReload=/usr/local/bin/consul reload
ExecStop=/usr/local/bin/consul leave
KillMode=process
Restart=on-failure
LimitNOFILE=65536

[Install]
WantedBy=multi-user.target
  1. Run the nomad job.
nomad run <nomad_job_name>.nomad

Roadmap

  • Expand the Nomad Cluster from 1 node to 2 node

  • Vault integratin

  • Put some useful API behind Kong

Inspiration