Skip to content

Instantly share code, notes, and snippets.

View thebsdbox's full-sized avatar
🐙

Daniel Finneran thebsdbox

🐙
View GitHub Profile
<div layout-gt-sm="row">
<md-input-container>
<label>SSH</label>
<input value="ssh {{instance.proxy_host}}@direct.{{host}} -p 8022" type="text" readonly="readonly" size="50">
<md-icon ngclipboard data-clipboard-text="ssh {{instance.proxy_host}}@direct.{{host}} -p 8022"class="material-icons">content_copy
<md-tooltip md-direction="top">Copy!</md-tooltip>
</md-icon>
<md-button class="md-raised" href="ssh://{{instance.proxy_host}}@direct.{{host}}:8022" target="_blank" rel="noopener noreferrer">
<md-icon class="material-icons">login</md-icon> SSH
</md-button>
@thebsdbox
thebsdbox / Tinkerbell on Equinixmetal.md
Last active January 23, 2023 14:22
Tinkerbell on Equinix Metal

The "perfect" virtual Tinkerbell environment on Equinix Metal

pre-requisites

This is a rough shopping list of skills/accounts that will be a benefit for this guide.

  • Equinix Metal portal account
  • GO experience (basic)
  • iptables usage (basic)
  • qemu usage (basic)
# Create Tinkerbell bridge
sudo ip link add tinkerbell type bridge
#
# Assign Address to bridge
sudo ip addr add 192.168.1.1/24 dev tinkerbell
# Create tap
sudo ip tuntap add dev tinkGuest mode tap user $USER
#
# Add to bridge
@thebsdbox
thebsdbox / k8s.sh
Last active November 8, 2022 17:56
Kubernetes Installer Ubuntu 2204
#!/bin/bash
echo This should set up everything needed for Kubernetes
sudo modprobe overlay
sudo modprobe br_netfilter
cat <<EOF | sudo tee /etc/sysctl.d/99-kubernetes-cri.conf
net.bridge.bridge-nf-call-iptables = 1
net.ipv4.ip_forward = 1
net.bridge.bridge-nf-call-ip6tables = 1
@thebsdbox
thebsdbox / how-to-k3s-ha.md
Last active July 22, 2022 15:01
HA K3S with kube-vip

The Architecture

Below is a sample architecture, no workers for this example :-)

  • VIP 192.168.0.40
  • K8S01 192.168.0.41
  • K8S02 192.168.0.42
  • DB01 192.168.0.43

Create our DB on DB01

apiVersion: apps/v1
kind: DaemonSet
metadata:
creationTimestamp: null
name: kube-vip-ds
namespace: kube-system
spec:
selector:
matchLabels:
name: kube-vip-ds
@thebsdbox
thebsdbox / bgp.go
Created August 27, 2020 13:43
This CLI will advertise a packet EIP through BGP
package main
import (
"context"
"flag"
"fmt"
"net"
"os"
"strconv"
"strings"
@thebsdbox
thebsdbox / main.go
Created February 10, 2021 12:43
🤮
package main
import (
"compress/gzip"
"crypto/tls"
"crypto/x509"
"encoding/json"
"io"
"io/ioutil"
"math"
@thebsdbox
thebsdbox / gist:e84aeff4ad071969c7b000271d868bbe
Created January 27, 2021 16:49
Cloud - to bare metal.sh
modprobe nbd
qemu-nbd --connect=/dev/nbd0 ./focal-server-cloudimg-amd64.img
partprobe /dev/nbd0
mkdir /mnt/image
mount /dev/nbd0p1 /mnt/image
cd /mnt/image
mount -t proc /proc proc/
mount --rbind /sys sys/
mount --rbind /dev dev/
chroot /mnt/image bash
@thebsdbox
thebsdbox / ccm_vip.yaml
Created January 26, 2021 15:30
ccm_vip.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: packet-cloud-controller-manager
namespace: kube-system
labels:
app: packet-cloud-controller-manager
spec:
replicas: 1
selector: