Skip to content

Instantly share code, notes, and snippets.

@mfenner
Last active May 15, 2023 11:20
Show Gist options
  • Save mfenner/ad06e5393a7aba6bdb809a5e56e22f76 to your computer and use it in GitHub Desktop.
Save mfenner/ad06e5393a7aba6bdb809a5e56e22f76 to your computer and use it in GitHub Desktop.
Configure Nomad for MacOS
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>homebrew.mxcl.nomad</string>
<key>LimitLoadToSessionType</key>
<array>
<string>Aqua</string>
<string>Background</string>
<string>LoginWindow</string>
<string>StandardIO</string>
<string>System</string>
</array>
<key>ProgramArguments</key>
<array>
<string>/opt/homebrew/opt/nomad/bin/nomad</string>
<string>agent</string>
<string>-config</string>
<string>/opt/homebrew/etc/nomad.d</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>StandardErrorPath</key>
<string>/opt/homebrew/var/log/nomad.log</string>
<key>StandardOutPath</key>
<string>/opt/homebrew/var/log/nomad.log</string>
<key>WorkingDirectory</key>
<string>/opt/homebrew/var</string>
</dict>
</plist>
# /opt/homebrew/etc/nomad.d/nomad.hcl
# Full configuration options can be found at https://www.nomadproject.io/docs/configuration
data_dir = "/opt/homebrew/etc/nomad/data"
bind_addr = "0.0.0.0"
server {
# license_path is required for Nomad Enterprise as of Nomad v1.1.1+
#license_path = "/etc/nomad.d/license.hclic"
enabled = true
bootstrap_expect = 1
}
client {
enabled = true
servers = ["127.0.0.1"]
host_volume "invenio" {
path = "/opt/homebrew/etc/invenio/data"
read_only = false
}
host_volume "postgres" {
path = "/opt/homebrew/etc/postgres/data"
read_only = false
}
host_volume "redis" {
path = "/opt/homebrew/etc/redis/data"
read_only = false
}
host_volume "traefik" {
path = "/opt/homebrew/etc/traefik/data"
read_only = false
}
host_volume "opensearch" {
path = "/opt/homebrew/etc/opensearch/data"
read_only = false
}
host_volume "mysql" {
path = "/opt/homebrew/etc/mysql/data"
read_only = false
}
}
plugin "docker" {
config {
endpoint = "unix:///Users/mfenner/.docker/run/docker.sock"
}
volumes {
enabled = true
}
}
plugin "raw_exec" {
config {
enabled = true
}
}
telemetry {
collection_interval = "1s"
disable_hostname = true
prometheus_metrics = true
publish_allocation_metrics = true
publish_node_metrics = true
}
# Requirements:
# - Homebrew installed
# - Docker for Mac installed
# Install nomad
brew install nomad
# setup file layout
# nomad config goes to /opt/homebrew/etc/nomad.d/nomad.hcl
# change docker endpoint to symlinked endpoint in user folder
# setup host volumes at /opt/homebrew/etc
# change brew services plist at /opt/homebrew/opt/nomad/homebrew.mxcl.nomad.plist
# start nomad service
brew services start nomad
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment