Skip to content

Instantly share code, notes, and snippets.

View thebsdbox's full-sized avatar
🐙

Daniel Finneran thebsdbox

🐙
View GitHub Profile
@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

@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"
# 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 / Dockerfile
Created April 28, 2020 22:16
gross Dockerfile
FROM golang:1.14.2-buster
ENV DEBIAN_FRONTEND=noninteractive
RUN echo deb http://ftp.us.debian.org/debian sid main >> /etc/apt/sources.list
RUN apt-get update; apt-get install -y libtool \
cmake \
automake \
autoconf \
make \
ninja-build \
curl \
@thebsdbox
thebsdbox / Drupal.yaml
Last active March 10, 2020 16:32
Drupal manifest
apiVersion: v1
kind: PersistentVolume
metadata:
name: local-volume-1
labels:
type: local
spec:
capacity:
storage: 10Gi
accessModes:
#!/bin/sh
CLUSTERS=250
MACHINES=5
echo "About to build a configuration for $CLUSTERS deployed clusters with $MACHINES each and written to the file $1"
sleep 5
for i in $( seq $CLUSTERS ); do
#!/bin/bash
echo "Beggining build of offline Kubernetes packages"
echo "Adding Kubernetes repository for image pull"
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
cat <<EOF >/etc/apt/sources.list.d/kubernetes.list
deb https://apt.kubernetes.io/ kubernetes-xenial main
EOF
# Details for building the repository
PROVIDER=cluster-api-provider-plunder
mkdir $PROVIDER
cd $PROVIDER
echo Create the initial repository for $PROVIDER
git init
echo Initialise a basic layout
GO111MODULE=on /usr/local/kubebuilder/bin/kubebuilder init --domain cluster.x-k8s.io --license apache2 --owner "The Kubernetes Authors"
@thebsdbox
thebsdbox / harbor_certs.sh
Last active May 2, 2019 15:49
This is a quick script that will generate certificates for harbor and SSL
#!/bin/bash
echo "This script will generate the requires certificates for harbour"
if [ -z "$1" ]
then
echo "No hostname or IP address specified for certificate"
exit 1
fi
@thebsdbox
thebsdbox / kube_map.json
Last active February 13, 2019 15:59
Example deployment map for plunder
{
"deployments": [
{
"name": "Configure host OS for kubernetes nodes",
"parallel": true,
"sessions": 0,
"hosts": [
"192.168.1.3",
"192.168.1.4",
"192.168.1.5",