Last active
March 1, 2021 02:41
-
-
Save mister2d/dbf3b0981948893edc455e9bcee73022 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cniVersion": "0.4.0", | |
"name": "macvlan-plex", | |
"plugins": [ | |
{ | |
"type": "macvlan", | |
"master": "enp3s0f0v1", | |
"ipam": { | |
"type": "dhcp" | |
} | |
}, | |
{ | |
"type": "portmap", | |
"capabilities": { | |
"portMappings": true | |
}, | |
"snat": true | |
} | |
] | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
job "plex" { | |
datacenters = ["home"] | |
type = "service" | |
constraint { | |
attribute = "${attr.unique.hostname}" | |
value = "plexhost" | |
} | |
group "htpc" { | |
network { | |
mode = "cni/macvlan-plex" | |
} | |
update { | |
max_parallel = 1 | |
health_check = "checks" | |
min_healthy_time = "10s" | |
healthy_deadline = "5m" | |
progress_deadline = "10m" | |
auto_revert = true | |
canary = 0 | |
stagger = "30s" | |
} | |
restart { | |
attempts = 3 | |
interval = "15s" | |
delay = "5s" | |
mode = "delay" | |
} | |
service { | |
name = "plex" | |
port = "32400" | |
canary_tags = ["test"] | |
address_mode = "alloc" | |
check { | |
port = "32400" | |
type = "http" | |
name = "healthcheck" | |
path = "/web/index.html" | |
interval = "10s" | |
timeout = "3s" | |
address_mode = "alloc" | |
check_restart { | |
limit = 3 | |
grace = "90s" | |
ignore_warnings = false | |
} | |
} | |
} | |
task "app" { | |
driver = "docker" | |
resources { | |
cpu = 16000 | |
memory = 8192 | |
} | |
env { | |
PUID = "1000" | |
PGID = "100" | |
PLEX_USERNAME = "myusername" | |
TZ = "EDT" | |
UMASK_SET = "022" | |
VERSION = "latest" | |
#PLEX_CLAIM = "" | |
NVIDIA_VISIBLE_DEVICES = "all" | |
NVIDIA_DRIVER_CAPABILITIES = "compute,video,utility" | |
} | |
config { | |
image = "linuxserver/plex:latest" | |
runtime = "nvidia" | |
cpuset_cpus = "8-11,24-27" | |
volumes = [ | |
"/srv/transcode:/transcode" | |
] | |
mounts = [ | |
{ | |
type = "volume" | |
target = "/config" | |
source = "plex_config" | |
readonly = false | |
volume_options = { | |
driver_config = { | |
name = "local" | |
options = [ | |
{ | |
device=":/srv/pool/data/plex/meta" | |
o = "addr=nfs.home.lan,rw,vers=4.2,rsize=1048576,wsize=1048576,hard,noatime,lookupcache=positive,timeo=600,retrans=2" | |
type="nfs" | |
} | |
] | |
} | |
} | |
}, | |
{ | |
type = "volume" | |
target = "/data" | |
source = "plex_data" | |
readonly = false | |
volume_options = { | |
driver_config = { | |
name = "local" | |
options = [ | |
{ | |
device=":/srv/pool/media" | |
o = "addr=nfs.home.lan,rw,vers=4.2,rsize=1048576,wsize=1048576,hard,noatime,lookupcache=positive,timeo=600,retrans=2" | |
type="nfs" | |
} | |
] | |
} | |
} | |
} | |
] | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment