Skip to content

Instantly share code, notes, and snippets.

View scyto's full-sized avatar

scyto

  • Seattle, WA, USA
  • 07:35 (UTC -07:00)
View GitHub Profile
@scyto
scyto / traefik-template.md
Last active August 18, 2023 21:51
traefik swarm template

Description

This template runs my experimental traefik server for evaluating if i move to it from handcrafted nginx proxy.

State Considerations for SWARM

traefik requires a static configuration - you need to pick either file based on command line based (or all commands need to be in your stack). you cannot mix these - for example if you put some settigs in a file doing additonal static config via command line then things kike env vars will be ignored i chose to put the static config in a traefik.yml file this seems to be considerd best practice in 2.6 by some i also configured a dynamic files folder - this is for aything that can't or shouldn't be configured in a docker file (middlewares, non-docker related routers etc)

Network Considerations

@scyto
scyto / portainer-agent-template.md
Last active February 24, 2025 09:24
migrate portainer agent to be managed by portainer

Description

This template deploys the portainer agent via portainer. I wanted a way to update the agent independently from the portainer web app. This is not a supported deployment architecture by portainer (which makes it odd they have the agent template in templates, any hoo)

DO NOT DO ANY OF THIS UNLESS YOU ARE PREPARED TO RESINTALL PORTAINER AND ITS AGENTS IF YOU GET ANY STEP WRONG YOU WILL BREAK PORTAINER

State Considerations for SWARM

none, this container can be cofigured entirely by the stack file

Network Considerations

@scyto
scyto / cloudflareddns-template.md
Created February 13, 2022 03:15
cloudflare DDNS updater swarm template

Description

This template runs my cloudflare dynamic DNS updater. It adjust the default container cron job from 5 minutes to 1 minute because i have failover WAN ports.

State Considerations for SWARM

none, this container can be cofigured entirely by env vars so i use those

Network Considerations

none, this need no special port mappings or other considerations consider using an secret to store the API

@scyto
scyto / infinitude-template.md
Last active February 24, 2025 09:24
infinitude for Carrier Infinity Thermostats (and Bryant)

Description

This template runs my infinitude proxy instance. This enables Carrier Inifinity Thermostats to be controlled by API, web page, home assistant etc) One note please for the love of god never buy a carrier heating system with one of these controls they are terrible in my experience. I inherited it, instead buy a nice generic heating/AC system that can support any standard thermostat.

State Considerations for SWARM

none, this container can be cofigured entirely by env vars so i use those

Network Considerations

none, this published port of 4000 for this container oveeride the interall 3000 because i have container that needed 3000 it can be reached by swarmIP:4000

@scyto
scyto / unifi-poller.template.md
Last active November 12, 2024 07:10
unifi poller swarm template

Description

This is my most complex stack to date. It runs the unifi-poller (uPoller) application consisting of an influx database, grafana dashboard and the uPoller collector.

State Considerations for SWARM

This has a lot of state (database, provisioning directory for granfa, state for grafana, config file for upoller, etc.)

This time i chose to store each of these in their own glusterfs volume mount using the gluster volumefs driver.

This has the advatages of creating folders that alread have the uid:gid of the grafan container (instead of messing around with chown and chmod)

@scyto
scyto / watchtower-template.md
Created February 12, 2022 21:04
watchtower swarm template

Description

This template runs watchtower. This is new for me so still seeing if i like it! (fingers cross this works, yes need to setuyp smtp email at some point, lol)

State Considerations for SWARM

none, this container can be cofigured entirely by env vars so i use those

Network Considerations

none, no published port is needed

@scyto
scyto / mosquitto-mqtt-template.md
Last active February 24, 2025 09:24
MQTT (mosquitto) swarm template

Description

This template runs mqtt for use with home automation

State Considerations for SWARM

With the latest version of mosquitto a single config is required to enable it to listen. You can do this by mapping thevconfig in a volume mount as per normal. However in this version i have implemented configs as these are available to the whole swarm

Network Considerations

none, this published default port of 1883 (if you need port 9001 then you already know why and how to modify this example :-) )

@scyto
scyto / npm-template.md
Last active February 24, 2025 09:24
Nginx Proxy Manager swarm template

Description

This template runs my experimental NPM service as part of evaluating if i should stop using my hand crafted nginx reverse proxy. Note change your passwords and don't use the examples bellow :-) )

State Considerations for SWARM

This container has a database, as such I store the data on the gluster volume. I am currenlty using a mount point to store the voume data on glusterfs. I restrict to 1 instance of each container to avoid database corruption from having two instances. Change example usernames and passwords as needed. leave hostname as db (name resolution works fine using the method)

@scyto
scyto / ouath2-proxy-template.md
Last active February 24, 2025 09:24
runs my oauth2-proxy for Azure based auth

Description

This template runs my ouath2-proxy for azure auth for web sites that don't have any native auth mechansim.

State Considerations for SWARM

none, this container can be cofigured entirely by env vars so i use those

Network Considerations

none, this published default port of 4180 for this container, it can be reached by swarmIP:4180

Placement Considerations

@scyto
scyto / gluster-fs-install.md
Last active February 24, 2025 09:25
Install & Configure GlusterFS

Assumes you installed debian, docker, etc as per the list here

Assumptions

  • I will have one gluster volume i will call glusterfs-vol1
  • I will install glusterfs on my docker nodes (best practice is to have seperate dedicated VMs)
  • I have 3 nodes in my cluster (docker01, docker02, docker03)
  • I will have one brick per node (brick1, brick2, brick3)
  • the volume will be dispered - more on volume types

Prepare Disks