Skip to content

Instantly share code, notes, and snippets.

View angrycub's full-sized avatar

Charlie Voiselle angrycub

View GitHub Profile
@angrycub
angrycub / _README.md
Created April 26, 2021 16:39
Single Node Nomad Configuration

Single Node Nomad Configuration

This is a complex and unsupported configuration

Nomad is designed to be a highly-available, quorum-based cluster scheduler. Nomad deployments need to have three or more server nodes and one or more client nodes.

That said, Nomad does provide a dev mode which enables you to run Nomad with a single agent process. However, Nomad dev agents do behave slightly different than non-dev agents. To create a more authentic feeling experience, you might want to run Nomad with a configuration

@angrycub
angrycub / eventstream.py
Created April 19, 2021 15:13
Minimal Python Client for Nomad Event Stream
import json
import requests
import sys
URL_BASE = "http://127.0.0.1:4646"
URL_API_PATH = "/v1/event/stream"
URL_QUERY_STRING = ""
#URL.QUERY_STRING = "?topic=Node:*"
url = URL_BASE + URL_API_PATH + URL_QUERY_STRING
@angrycub
angrycub / basic-nginx.ctmpl
Created April 14, 2021 17:32
Basic NGINX template for an example
server {
listen {{ env "PORT" }};
server_name {{ env "DOMAIN" }};
location / {
proxy_pass http://{{ env "UPSTREAM" }};
}
}
@angrycub
angrycub / unfederate.md
Created November 25, 2020 14:25
Manually Unfederating a Nomad Cluster using a Network Partition
title date draft tags menu
Manually Unfederating a Nomad Cluster using a Network Partition
2017-12-07 12:49:20 -0500
false
nomad
main
parent
Nomad
@angrycub
angrycub / docker.md
Created October 15, 2020 23:47
Enabling pre-Nomad 0.12 Docker mount behavior for dev agents

Create a configuration file and a sample job.

docker.hcl

plugin "docker" { 
  config {
     volumes {
       enabled = true
     } 
@angrycub
angrycub / example.nomad
Created October 7, 2020 19:57
Using the mac_address configuration for a Docker task
job "example" {
datacenters = ["dc1"]
group "cache" {
task "redis" {
driver = "docker"
config {
image = "redis:3.2"
mac_address = "A0:97:FA:13:93:03"
@angrycub
angrycub / fabio-system.nomad
Created March 19, 2018 16:27
Nomad Job Description for Fabio with Consul Registration
job "fabio" {
datacenters = ["dc1"]
type = "system"
update {
stagger = "5s"
max_parallel = 1
}
group "linux-amd64" {
task "fabio" {
constraint {
@angrycub
angrycub / instructions.md
Created November 29, 2017 23:20
Resetting ink subsystem on HP Color Inkjet 5180

Resetting HP Color Inkjet 5180

Ink Error 0xc18a0206

Please perform the below steps:

  1. Press and hold the “left arrow” key, then press the “Setup” key and release both keys.

Display should say “Enter Special Key Combo”

@angrycub
angrycub / Dockerfile
Last active September 14, 2017 21:23
Nomad Job File for http-echo based on Windows Nano Server
FROM microsoft/nanoserver
ENV HTTP_ECHO_DOWNLOAD_URL "https://github.com/hashicorp/http-echo/releases/download/v0.2.3/http-echo_0.2.3_windows_amd64.zip"
ENV HTTP_ECHO_PORT 8080
ENV HTTP_ECHO_STRING "Hello World"
RUN powershell.exe -Command ; \
$handler = New-Object System.Net.Http.HttpClientHandler ; \
$client = New-Object System.Net.Http.HttpClient($handler) ; \
$client.Timeout = New-Object System.TimeSpan(0,30,0) ; \