Skip to content

Instantly share code, notes, and snippets.

View tklauser's full-sized avatar

Tobias Klauser tklauser

View GitHub Profile
@joestringer
joestringer / skb_free.bt
Created April 23, 2020 19:56
bpftrace script for gathering stack traces for dropped packets
#!/usr/bin/env bpftrace
/*
* skb_free.bt Trace skb drops when the socket is associated with the skb.
* For Linux, uses bpftrace and eBPF.
*
* USAGE: skb_free.bt
*
* Copyright (c) 2020 Joe Stringer.
* Licensed under the Apache License, Version 2.0 (the "License")
*
@joestringer
joestringer / debug_iptables.sh
Last active May 8, 2020 00:02
Debug netfilter on a Cilium-managed kubernetes node
#!/bin/bash
STANDARD_CHAINS="CILIUM_INPUT CILIUM_FORWARD CILIUM_OUTPUT"
CUSTOM_CHAINS="CILIUM_PRE CILIUM_POST CILIUM_OUTPUT"
TABLES="raw mangle nat"
NAMESPACE="kube-system"
IP=""
NODE=""
ONLY_CLEAR=false
@borkmann
borkmann / micro-k8s-setup.md
Last active August 18, 2024 07:44 — forked from joestringer/micro-k8s-setup.md
MicroK8s setup for Cilium

Set up microk8s with Cilium for development

Microk8s is a Canonical project to provide a kubernetes environment for local development, similar to minikube but without requiring a separate VM to manage. These instructions describe setting it up for common development use cases with Cilium and may be helpful in particular for testing BPF kernel extensions with Cilium.

Microk8s will run its own version of docker for the kubernetes runtime, so if you have an existing docker installation then this may be confusing, for instance when building images the image may be stored with one of these installations and not the other. This guide assumes you will run both docker daemon instances, and use your existing docker-ce for building Cilium while using the microk8s.docker daemon instance for the runtime of your kubernetes pods.

Requirements

@joestringer
joestringer / micro-k8s-setup.md
Last active April 20, 2021 17:06
MicroK8s development environment setup for Cilium

Set up microk8s with Cilium for development

Microk8s is a Canonical project to provide a kubernetes environment for local development, similar to minikube but without requiring a separate VM to manage. These instructions describe setting it up for common development use cases with Cilium and may be helpful in particular for testing BPF kernel extensions with Cilium.

Microk8s will run its own containerd runtime, which may be initially confusing when building containers locally with docker. This guide assumes that you will use docker locally for building containers, and push these into a microk8s registry for use by containerd in the microk8s environment.

This guide works with MicroK8s 1.14 or above, with containerd. If you are running an earlier version, see the previous instructions.

Requirements