chore: sync homelab ops, identity, and monitoring docs
This commit is contained in:
16
infrastructure/hawser-nomad/.env.example
Normal file
16
infrastructure/hawser-nomad/.env.example
Normal file
@@ -0,0 +1,16 @@
|
||||
TZ=America/Chicago
|
||||
|
||||
# Hawser listener for Dockhand Standard mode
|
||||
HAWSER_PORT=2376
|
||||
HAWSER_BIND_ADDRESS=0.0.0.0
|
||||
HAWSER_TOKEN=CHANGE_ME
|
||||
HAWSER_AGENT_NAME=nomad
|
||||
HAWSER_LOG_LEVEL=info
|
||||
|
||||
# Keep the stack path identical inside and outside the container so Dockhand
|
||||
# can deploy stacks that use relative bind mounts.
|
||||
STACKS_DIR=/opt/hawser-nomad/stacks
|
||||
|
||||
# Set to any non-empty value to skip disk-usage collection if NOMAD's mounts
|
||||
# make df collection too noisy or slow.
|
||||
SKIP_DF_COLLECTION=
|
||||
21
infrastructure/hawser-nomad/README.md
Normal file
21
infrastructure/hawser-nomad/README.md
Normal file
@@ -0,0 +1,21 @@
|
||||
# NOMAD Hawser Agent
|
||||
|
||||
- **Repo stack path:** `/home/fizzlepoof/repos/truenas-stacks/infrastructure/hawser-nomad`
|
||||
- **Suggested live stack path:** `/opt/hawser-nomad`
|
||||
- **Dockhand environment:** existing `NOMAD` Hawser Standard environment on PD
|
||||
- **Why Standard mode:** NOMAD is on the LAN with a stable IP, so Dockhand can connect directly without the extra Edge-mode WebSocket plumbing
|
||||
|
||||
Bring-up:
|
||||
|
||||
```bash
|
||||
cd /opt/hawser-nomad
|
||||
cp .env.example .env
|
||||
bash bin/prepare_nomad.sh --up
|
||||
```
|
||||
|
||||
Notes:
|
||||
|
||||
- Use the Hawser token already configured in Dockhand's `NOMAD` environment.
|
||||
- Hawser listens on port `2376` by default, matching the existing Dockhand environment entry.
|
||||
- `STACKS_DIR` is bind-mounted to the same host path inside the container so Dockhand can deploy stacks that use relative bind mounts.
|
||||
- This is a standalone NOMAD deployment under `/opt`, not part of the core Project N.O.M.A.D. managed stack.
|
||||
25
infrastructure/hawser-nomad/bin/prepare_nomad.sh
Executable file
25
infrastructure/hawser-nomad/bin/prepare_nomad.sh
Executable file
@@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
STACK_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
|
||||
ENV_FILE="${ENV_FILE:-$STACK_DIR/.env}"
|
||||
DO_UP="${1:-}"
|
||||
|
||||
if [[ ! -f "$ENV_FILE" ]]; then
|
||||
echo "Missing $ENV_FILE - copy .env.example to .env and fill in real values first." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
set -a
|
||||
# shellcheck disable=SC1090
|
||||
source "$ENV_FILE"
|
||||
set +a
|
||||
|
||||
mkdir -p "$STACKS_DIR"
|
||||
docker compose --env-file "$ENV_FILE" -f "$STACK_DIR/docker-compose.yaml" config >/dev/null
|
||||
|
||||
if [[ "$DO_UP" == "--up" ]]; then
|
||||
docker compose --env-file "$ENV_FILE" -f "$STACK_DIR/docker-compose.yaml" up -d
|
||||
docker compose --env-file "$ENV_FILE" -f "$STACK_DIR/docker-compose.yaml" ps
|
||||
fi
|
||||
19
infrastructure/hawser-nomad/docker-compose.yaml
Normal file
19
infrastructure/hawser-nomad/docker-compose.yaml
Normal file
@@ -0,0 +1,19 @@
|
||||
services:
|
||||
hawser:
|
||||
image: ghcr.io/finsys/hawser:latest
|
||||
container_name: hawser-nomad
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "${HAWSER_BIND_ADDRESS:-0.0.0.0}:${HAWSER_PORT:-2376}:2376"
|
||||
environment:
|
||||
TZ: ${TZ}
|
||||
PORT: "2376"
|
||||
BIND_ADDRESS: ${HAWSER_BIND_ADDRESS}
|
||||
TOKEN: ${HAWSER_TOKEN}
|
||||
AGENT_NAME: ${HAWSER_AGENT_NAME}
|
||||
LOG_LEVEL: ${HAWSER_LOG_LEVEL}
|
||||
STACKS_DIR: ${STACKS_DIR}
|
||||
SKIP_DF_COLLECTION: ${SKIP_DF_COLLECTION}
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
- ${STACKS_DIR}:${STACKS_DIR}
|
||||
Reference in New Issue
Block a user