Skip to content

Instantly share code, notes, and snippets.

@scyto
scyto / debian-vm-install.md
Last active February 1, 2024 05:23
Installing Debian as VM

This is the base of all my linux VM installs I use for docker etc

Prep Hypervisor (instructions vary based on hypervisor so this is generic)

  • Download netinst ISO from debian website
  • Create a VM on your hypervsor
  • VM Machine Spec:
    • 200GB
    • 2 CPU
    • 4GB RAM
  • Attach to external network
@scyto
scyto / debian-docker-install.md
Last active January 16, 2024 15:27
Install docker on debian the easy way

This is the easiest way to install docker and docker compose on debian.

Better yet docker updates can be done by rerunning the script mentioned or using apt upgrade etc

Assumes you followed Debian VM Install Instructions

Install Docker

Login as yourself

curl -fsSL https://get.docker.com -o get-docker.sh
@scyto
scyto / docker-swarm-install.md
Last active December 11, 2023 22:51
bootstrap docker swarm

i like using docker swarm for home labs

assumes you installed docker like this

Initialize Swarm on first docker node (management node)

sudo docker-swarm init

it will produced output something like this

@scyto
scyto / docker-swarm-portainer.md
Last active March 23, 2023 20:05
Installing Portainer on a swarm

This is how to install portainer on the swarm you created using this gist note this should work on non-swarm installs too!

Setup Portainer

Download the portain stack yaml that will do this for you

curl -L https://downloads.portainer.io/ce2-17/portainer-agent-stack.yml -o portainer-agent-stack.yml

Using keepalived for node ingress and dns relaibility

This assumes you have installed a docker swarm

Introduction

When one has a docker swarm a container running on any node in the swarm can be accesed using any IP address of any swarm memeber.

For example if you had a single web server running on port 80, on one node of a swarm you could access the web server with any of the following IP addresses:

  • server1-ip:80
  • server2-ip:80
@scyto
scyto / docker-swarm-architecture.md
Last active April 29, 2024 19:12
My Docker Swarm Architecture
@scyto
scyto / gluster-fs-install.md
Last active March 14, 2024 21:29
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

@scyto
scyto / ouath2-proxy-template.md
Last active February 21, 2024 15:54
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 / npm-template.md
Last active May 2, 2024 22:21
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 / mosquitto-mqtt-template.md
Last active October 2, 2023 04:23
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 :-) )