Skip to content

Instantly share code, notes, and snippets.

View johananl's full-sized avatar

Johanan Liebermann johananl

View GitHub Profile
@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 / 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 / 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 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 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 / main.tf
Last active July 23, 2019 09:58
AKS cluster using Terraform
provider "azurerm" {}
variable "cluster_name" {
default = "aks-test"
}
resource "azurerm_resource_group" "test" {
name = "${var.cluster_name}"
location = "West Europe"
}
@johananl
johananl / README.md
Last active January 6, 2020 11:11
Privileged DaemonSet

Privileged DaemonSet

kubectl apply -f privileged-ds.yaml
kubectl exec -it debug-xxxxx sh
chroot /host
@johananl
johananl / registry.yaml
Created July 16, 2019 13:21
Private Docker registry on k8s
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: registry
---
apiVersion: policy/v1beta1
kind: PodSecurityPolicy
metadata:
name: registry
@johananl
johananl / README.md
Created July 17, 2019 14:55
Generate self-signed TLS certificate
openssl req -x509 -newkey rsa:4096 -keyout mykey.key -out mycert.pem -days 365 -nodes -subj '/CN=localhost'
@johananl
johananl / postgres.service
Last active March 3, 2020 13:51
Run a Docker container as a systemd unit
[Unit]
Description=PostgreSQL
After=docker.service
Requires=docker.service
[Service]
TimeoutStartSec=0
Restart=always
ExecStartPre=-/usr/bin/docker stop %n
ExecStartPre=-/usr/bin/docker rm %n