Skip to content

Instantly share code, notes, and snippets.

View josephbolus's full-sized avatar

Joseph Bolus josephbolus

View GitHub Profile
@dhh
dhh / linux-setup.sh
Last active July 1, 2024 16:45
linux-setup.sh
# THIS LINUX SETUP SCRIPT HAS MORPHED INTO A WHOLE PROJECT: HTTPS://OMAKUB.ORG
# PLEASE CHECKOUT THAT PROJECT INSTEAD OF THIS OUTDATED SETUP SCRIPT.
#
#
# Libraries and infrastructure
sudo apt update -y
sudo apt install -y \
docker.io docker-buildx \
build-essential pkg-config autoconf bison rustc cargo clang \
@scyto
scyto / swarm-updating-shepherd.md
Created May 15, 2022 02:05
use shepherd to update images

Update Swarm Images

i wanted to update swarm images whenever there is a new image available (even at the risk of breaking something)

it seems watchtower can't do this for swarm stacks/services - only one off containers.

I found this great container from https://github.com/djmaze/shepherd

placement considerations

Must be placed on a manager node.

@scyto
scyto / docker-swarm-architecture.md
Last active July 6, 2024 18:06
My Docker Swarm Architecture
@prologic
prologic / consul.yml
Created October 11, 2021 07:21
Consul Stack (Docker Swarm)
---
version: "3.8"
services:
seed:
image: consul:latest
environment:
- "CONSUL_LOCAL_CONFIG={\"disable_update_check\": true}"
- "CONSUL_BIND_INTERFACE=eth0"
entrypoint:
@shebpamm
shebpamm / kickstart.cfg.j2
Created September 24, 2021 11:32
Kickstart template for RHEL 8
lang en_US
keyboard us
timezone Europe/Helsinki --isUtc
reboot
text
cdrom
bootloader --location=mbr --append="rhgb quiet crashkernel=auto"
zerombr
clearpart --all --initlabel
autopart
@wllmsash
wllmsash / assigning-static-ip-addresses-in-wsl2.md
Last active June 27, 2024 20:56
Assigning Static IP Addresses in WSL2

Assigning Static IP Addresses in WSL2

WSL2 uses Hyper-V for networking. The WSL2 network settings are ephemeral and configured on demand when any WSL2 instance is first started in a Windows session. The configuration is reset on each Windows restart and the IP addresses change each time. The Windows host creates a hidden switch named "WSL" and a network adapter named "WSL" (appears as "vEthernet (WSL)" in the "Network Connections" panel). The Ubuntu instance creates a corresponding network interface named "eth0".

Assigning static IP addresses to the network interfaces on the Windows host or the WSL2 Ubuntu instance enables support for the following scenarios:

Simple envoy configuration with basic authentication and without authorization service

Sometime you need scrape prometheus metrics from external envoy that deploy not to kubernetes environment

You can use iptable or other stuff on external server to allow only trusted IP for scraping metrics - but for dynamic infrastructure some time it's hard to support it.

Envoy can expose this metrics more elegant style - using basic auth

Simple envoy.yaml

#!/bin/bash
PACKAGE=$(basename "$0")
# .----. _ .-. _ _
# `--. ::_;: :.-. :_;:_;
# ,','.-.: `'.' .--. .-..-.
# .'.'_ : :: . `.' '_.': :: :
# :____;:_;:_;:_;`.__.': ::_;
# .-. :
@mkfares
mkfares / docker-swarm-configs.md
Created August 16, 2020 12:37
Docker Swarm - Managing Configurations

Docker Swarm - Managing Configurations

Docker allows storing configurations outside docker images and running containers. This feature, named configs, eliminates the need to use volumes, bind-mount, or environment variables to pass configurations to containers.

The configs have the following characteristics:

  • Configs are not encrypted (secrets are encrypted)
  • Config values can be strings or binary data
  • Config values have maximum size of 500 kB
  • Configs are mounted as a file in the container filesystem. The default location is /<config-name> in the container
  • Configs can be added or removed from a service at any time
@lfache
lfache / docker-compose.yaml
Created July 15, 2020 12:46
Hardened Traefik sample with whoami + HTTPS everywhere/redirect
version: "3.8"
services:
dockerproxy:
image: tecnativa/docker-socket-proxy
environment:
- CONTAINERS=1
networks:
- socket_docker
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"