Skip to content

Instantly share code, notes, and snippets.

View caiocampoos's full-sized avatar
🐢
fastest around

Caio Rosa caiocampoos

🐢
fastest around
View GitHub Profile
for i in */.git; do ( echo $i; cd $i/..; git pull; ); done
#!/bin/sh
for i in */.git; do ( echo $i; cd $i/..; git pull; ); done
@caiocampoos
caiocampoos / namespace-nuker
Created February 9, 2024 03:29
Namespace Nuker
(
NAMESPACE=your-rogue-namespace
kubectl proxy &
kubectl get namespace $NAMESPACE -o json |jq '.spec = {"finalizers":[]}' >temp.json
curl -k -H "Content-Type: application/json" -X PUT --data-binary @temp.json 127.0.0.1:8001/api/v1/namespaces/$NAMESPACE/finalize
)
(
NAMESPACE=your-rogue-namespace
kubectl proxy &
kubectl get namespace $NAMESPACE -o json |jq '.spec = {"finalizers":[]}' >temp.json
curl -k -H "Content-Type: application/json" -X PUT --data-binary @temp.json 127.0.0.1:8001/api/v1/namespaces/$NAMESPACE/finalize
)
@caiocampoos
caiocampoos / microk8s_in_lxc.md
Created February 28, 2024 20:22 — forked from acj/microk8s_in_lxc.md
Installing microk8s in an LXC container

Installing microk8s in an LXC container

I wanted to run Microk8s on a Proxmox 6 host inside of an LXC container. These are my notes from the journey.

  1. Create a privileged LXC container through the Proxmox web interface
  • Enable nesting and FUSE
    • In Proxmox UI, select container, then Options > Features > Check nesting and FUSE boxes
  1. SSH into the Proxmox host and edit the container's config in /etc/pve/lxc/.conf
    • Add the following lines
  • lxc.apparmor.profile: unconfined
@caiocampoos
caiocampoos / ubuntu-template.sh
Last active June 16, 2024 18:59
script to create a vm template in proxmox with cloud init
#!/bin/sh
# install tools
apt update -y && apt install nano wget curl libguestfs-tools -y
# remove old image
rm -rfv ubuntu-22.04-server-cloudimg-amd64-disk-kvm.img
# remove old template container - WILL DESTROY COMPLETELY
qm destroy 999 --destroy-unreferenced-disks 1 --purge 1
# download new image
wget http://cloud-images.ubuntu.com/releases/22.04/release/ubuntu-22.04-server-cloudimg-amd64-disk-kvm.img
# add agent to image