Skip to content

Instantly share code, notes, and snippets.

View AlexsJones's full-sized avatar
🧟‍♀️

Alex Jones AlexsJones

🧟‍♀️
View GitHub Profile
@AlexsJones
AlexsJones / README.md
Created January 10, 2024 17:27
Fix neovim on maca

Install .rustup directory in home, otherwise there are a bunch of rust-analyzer issues

@AlexsJones
AlexsJones / cp-0
Created March 6, 2023 08:34
DQLite debugging
ubuntu@raspbernetes-0:~/dqlite-issue-repro$ cat /var/snap/microk8s/current/var/kubernetes/backend/cluster.yaml
- Address: 192.168.88.239:19001
ID: 3297041220608546238
Role: 0
- Address: 192.168.88.249:19001
ID: 10829805846545420511
Role: 0
- Address: 192.168.88.246:19001
ID: 8819719984785607608
Role: 0

hardware

  • pi4 x3 control-plane nodes
  • pi4 x1 worker nodes
  • Attached disks on /dev/sda on each node

Install

I don't think I enabled coreDNS by default

You must run these commands on all nodes, including the workers ( especially cgroup enablement for containerd )

sudo swapoff -a
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
#!/bin/sh
set -e
set -o noglob
# Usage:
# curl ... | ENV_VAR=... sh -
# or
# ENV_VAR=... ./install.sh
#
# Environment variables:
@AlexsJones
AlexsJones / install.sh
Created November 10, 2022 10:20
Single node kubeadm based k8s
#!/bin/bash
sudo apt-get update
sudo apt-get install -y apt-transport-https ca-certificates curl
curl -fsSLo containerd-config.toml \
https://gist.githubusercontent.com/oradwell/31ef858de3ca43addef68ff971f459c2/raw/5099df007eb717a11825c3890a0517892fa12dbf/containerd-config.toml
sudo mkdir /etc/containerd
sudo mv containerd-config.toml /etc/containerd/config.toml
curl -fsSLo containerd-1.5.13-linux-amd64.tar.gz \
@AlexsJones
AlexsJones / README.md
Last active November 10, 2022 17:15
klustered
  1. Stop containerd
sudo systemctl stop containerd
sudo systemctl disable containerd
  1. Alias
@AlexsJones
AlexsJones / gist:0c68632887ee40c36a8cc37ee1451ce4
Created August 7, 2022 16:40
webhook configuration with kubebuilder
```
kubebuilder init --domain=XXXXXXXXXX: use the rest of the flags as needed (e.g. --license or --owner).
kubebuilder create api --resource=false --controller=false --group=core --version=v1 --kind=Pod: use the rest of the flags as needed.
kubebuilder create webhook --group=core --version=v1 --kind=Pod ...: extra flags will be needed here
```
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: read-only
rules:
- apiGroups:
- ""
resources:
- '*'
verbs:
@AlexsJones
AlexsJones / README.md
Last active June 28, 2022 07:45
Observability 1,2,3

Observability in 1,2,3 with MicroK8s

sudo snap install microk8s --classic
sudo microk8s addons repo add core --force https://github.com/canonical/microk8s-core-addons.git --reference feature-kube-prom-stack
sudo microk8s enable observability