Skip to content

Instantly share code, notes, and snippets.

View johananl's full-sized avatar

Johanan Liebermann johananl

View GitHub Profile
@johananl
johananl / README.md
Last active May 13, 2019 09:31
Run a debug container on k8s
kubectl run -it --rm debug-$RANDOM --image-pull-policy=Always --image=alpine --restart=Never sh
@johananl
johananl / README.md
Last active April 24, 2019 15:49
Serve Flatcar images using Caddy
curl https://getcaddy.com | bash -s personal

mkdir caddy
cd $_

cat <<EOF >Caddyfile
0.0.0.0:8080
browse
EOF
@johananl
johananl / README.md
Last active February 9, 2023 04:39
Debugging iPXE + HTTPS

Debugging iPXE image Download over HTTPS

Build iPXE

Get the source:

git clone git://git.ipxe.org/ipxe.git
@johananl
johananl / README.md
Last active January 27, 2019 19:39
MetalLB on Packet

Requirements

  • A k8s cluster deployed on Packet with 2 worker nodes.
  • BGP enabled on both worker nodes.
  • An IPv4 block allocated on Packet. A single address is enough for a single exposed service.

Deploy MetalLB

kubectl apply -f https://raw.githubusercontent.com/google/metallb/v0.7.3/manifests/metallb.yaml
@johananl
johananl / Dockerfile
Last active January 24, 2019 21:46
iperf on k8s
FROM debian
RUN apt-get update && apt-get install -y iperf && apt-get clean
CMD exec /bin/bash -c "trap : TERM INT; sleep infinity & wait"
@johananl
johananl / instructions.md
Last active January 13, 2019 16:12
Running a local k8s cluster using Vagrant and kubeadm

Requirements

These instructions assume running Vagrant with a libvirt provider.

Install the vagrant-libvirt plugin using the following:

vagrant plugin install vagrant-libvirt
@johananl
johananl / httpbin.yaml
Created January 11, 2019 00:10
k8s ingress test (httpbin)
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: httpbin
labels:
app: httpbin
spec:
replicas: 3
selector:
@johananl
johananl / main.tf
Created January 4, 2019 21:59
Spot servers on Packet
provider "packet" {
auth_token = "${var.auth_token}"
}
# Packet auth token. Generate it on your Packet account. More info:
# https://support.packet.com/kb/articles/api-integrations
variable "auth_token" {}
# The Packet project ID. More info: https://support.packet.com/kb/articles/api-integrations
variable "project_id" {}
@johananl
johananl / README.md
Created October 30, 2018 20:14
KVM in runc

KVM in runc

Running a KVM virtual machine inside a runc contianer.

Requirements

  • A host which can run KVM virtual machines using Vagrant.

Setting up a test VM

@johananl
johananl / Dockerfile
Last active October 17, 2018 16:40
KVM + Vagrant in Docker
# This is based on a Redhat blogpost:
# https://www.projectatomic.io/blog/2014/10/libvirtd_in_containers/
# https://github.com/projectatomic/docker-image-examples/blob/master/rhel-libvirt/libvirtd/Dockerfile
FROM centos:7
ENV VAGRANT_VERSION=2.2.0
RUN yum -y install systemd libvirt-daemon-driver-* libvirt-daemon libvirt-daemon-kvm libvirt-devel qemu-kvm gcc make wget openssh-clients && yum clean all; \
(cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i; done); \
rm -f /lib/systemd/system/multi-user.target.wants/*;\