Skip to content

Instantly share code, notes, and snippets.

View uablrek's full-sized avatar

Lars Ekman uablrek

View GitHub Profile
@uablrek
uablrek / kubeadm-config.yaml
Created May 6, 2020 05:38
Example kubeadm.config for dual-stack
apiVersion: kubeadm.k8s.io/v1beta2
bootstrapTokens:
- groups:
- system:bootstrappers:kubeadm:default-node-token
token: 11n1ns.vneshg4ikfoyiy09
ttl: 24h0m0s
usages:
- signing
- authentication
kind: InitConfiguration
@uablrek
uablrek / mserver-hostnet.yaml
Created May 7, 2020 08:50
K8s POD with lots of iptools loaded in hostNetwork as a DaemonSet
apiVersion: v1
kind: ServiceAccount
metadata:
name: mserver
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: mserver
rules:
@uablrek
uablrek / mptcp.c
Created May 14, 2020 12:04
Small client/server MPTCP program
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <stdlib.h>
#include <netinet/in.h>
#include <unistd.h>
#include <netdb.h>
#include <time.h>
@uablrek
uablrek / simple-client-2.yaml
Created May 25, 2020 07:08
NSM simple-client with multiple nsmX interfaces
---
apiVersion: apps/v1
kind: Deployment
spec:
selector:
matchLabels:
networkservicemesh.io/app: "simple-client-2"
replicas: 3
template:
metadata:
@uablrek
uablrek / remove-nodeport.go
Created November 7, 2020 08:26
A go program that clears nodePorts for a service on K8s
package main
import (
"context"
"flag"
"fmt"
"log"
"os"
core "k8s.io/api/core/v1"
@uablrek
uablrek / README.md
Last active May 11, 2021 07:15
Kubernetes sig-network e2e tests

Kubernetes sig-network e2e tests

The list was produced by executing e2e tests with --ginkgo.dryRun=true and post-processing the result.

kubetest --provider=skeleton --test \
  --test_args="--ginkgo.focus=\[sig-network\] --ginkgo.dryRun=true --ginkgo.noColor=true" > \
  /tmp/sig-network-tests-raw.txt
grep -oE 'PASSED[^"]*' sig-network-tests-raw.txt | sort > /tmp/sig-network-tests.txt
sed -i -e 's,PASSED ,,' /tmp/sig-network-tests.txt
package main
import (
"fmt"
"log"
"net"
"os"
"strings"
)
@uablrek
uablrek / af_packet.c
Created March 17, 2023 10:06
AF_PACKET buffer increase test program
/*
Provided under the MIT No Attribution License
https://opensource.org/license/mit-0/
Copyright 2023 Lars Ekman <emil71se@yahoo.com>
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files
(the “Software”), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge,
@uablrek
uablrek / README.md
Last active March 29, 2023 06:24
Ipv4 address preservation in K8s KinD

Ipv4 address preservation in K8s KinD

In large cluster IPv4 addresses can become a limiting resource. In this gist we explore a way to assign IPv4 addresses to PODs on just some nodes using the MultiCIDRRangeAllocator feature. Project Calico may present other possibilities.

Configuration

@uablrek
uablrek / README.md
Last active September 12, 2023 08:31
K8s - core dumps from containers

k8s-coredump

Specify a core pattern on the host:

echo "/var/log/dumps/core.%h.%e.%P" > /proc/sys/kernel/core_pattern

This is global and will be seen inside containers.

Create a binary that causes a core-dump: