Skip to content

Instantly share code, notes, and snippets.

View wintersolutions's full-sized avatar

wintersolutions wintersolutions

View GitHub Profile
#!/bin/bash
# This script has been tested on Ubuntu 20.04
# For other versions of Ubuntu, you might need some tweaking
echo "[TASK 1] Install containerd runtime"
apt update -qq >/dev/null 2>&1
apt install -qq -y containerd apt-transport-https >/dev/null 2>&1
mkdir /etc/containerd
containerd config default > /etc/containerd/config.toml
document.querySelectorAll("pre code").forEach((element) =>
{
let html = element.outerHTML
let pattern = html.match(/\s*\n[\t\s]*/)
element.outerHTML = html.replace(new RegExp(pattern, "g"),'\n')
}
)
#!/bin/sh
LXDINTERFACE=lxdbr0
LXDDOMAIN=lxd
LXDDNSIP=`ip addr show lxdbr0 | grep -Po 'inet \K[\d.]+'`
/usr/bin/systemd-resolve --interface ${LXDINTERFACE} \
--set-dns ${LXDDNSIP} \
--set-domain ${LXDDOMAIN}
#!/bin/sh
LXDINTERFACE=lxdbr0
/usr/bin/systemd-resolve --interface ${LXDINTERFACE} --revert
[Unit]
Description=LXD host DNS service
After=multi-user.target
[Service]
Type=simple
ExecStart=/usr/local/bin/lxdhostdns_start.sh
RemainAfterExit=true
ExecStop=/usr/local/bin/lxdhostdns_stop.sh
StandardOutput=journal
apiVersion: v1
kind: ConfigMap
metadata:
namespace: metallb-system
name: config
data:
config: |
address-pools:
- name: default
protocol: layer2
[Unit]
Description = Port forward to services
Before=network.target
[Service]
Type=oneshot
ExecStart=/root/config/ipforward-start.sh
ExecStop=/root/config/ipforward-stop.sh
RemainAfterExit=true
StandardOutput=journal
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
name: letsencrypt-prod
namespace: cert-manager
spec:
acme:
server: https://acme-v02.api.letsencrypt.org/directory
email: MYEMAIL
privateKeySecretRef:
#!/bin/bash
# This script has been tested on Ubuntu 20.04
# For other versions of Ubuntu, you might need some tweaking
echo "[TASK 1] Install containerd runtime"
apt update -qq >/dev/null 2>&1
apt install -qq -y containerd apt-transport-https >/dev/null 2>&1
mkdir /etc/containerd
containerd config default > /etc/containerd/config.toml
#!/usr/bin/env bash
# outside connections
/usr/sbin/iptables -w -t nat -A PREROUTING -d EXTERNALIP -p tcp --dport 80 -j DNAT --to-destination INGRESSIP:80
/usr/sbin/iptables -w -t nat -A PREROUTING -d EXTERNALIP -p tcp --dport 443 -j DNAT --to-destination INGRESSIP:443
/usr/sbin/iptables -w -t nat -A PREROUTING -d EXTERNALIP -p tcp --dport 6443 -j DNAT --to-destination K8IP:6443
# host
/usr/sbin/iptables -w -t nat -A OUTPUT -p tcp --dport 80 -j DNAT --to-destination INGRESSIP:80
/usr/sbin/iptables -w -t nat -A OUTPUT -p tcp --dport 443 -j DNAT --to-destination INGRESSIP:443