Skip to content

Instantly share code, notes, and snippets.

View aojea's full-sized avatar

Antonio Ojea aojea

View GitHub Profile
@aojea
aojea / README.md
Last active June 21, 2025 03:59
Network Device Management with container runtimes

Network Device Management with container runtimes

This document provides a hands-on guide to understanding how runtimes interacts with network devices and namespaces, focusing on the new "Network Devices" feature described in the OCI (Open Container Initiative) runtime specification. The feature is expected to be released in the version 1.3.0 of the OCI specification.

In high-level container orchestration systems like Kubernetes, the management of network namespaces and interfaces is handled by the [Container Runtime Interface

# based on https://taozhi.medium.com/the-amazing-chroot-making-simply-ssh-to-each-nodes-in-kubernetes-a3448a665c95
# kubectl exec -it ssh-pod -- chroot /host /bin/bash
apiVersion: v1
kind: Pod
metadata:
name: ssh-pod
labels:
app: ssh-pod
spec:
hostNetwork: true
@aojea
aojea / README.md
Last active June 19, 2025 13:46
Navigating Linux Network Namespaces and Interfaces

Navigating Linux Network Namespaces and Interfaces

Network namespaces create isolated network stacks, including network devices, IP addresses, routing tables, rules , ... This separation is crucial for containerization.

Network namespaces also contain network devices that can live exactly on one network namespace:

physical network device can live in exactly one network namespace. When a network namespace is freed (i.e., when the last

@aojea
aojea / kube-api-reviews-comments.py
Created February 17, 2025 15:56
Download kubernetes PR api-review with code and comments
import requests
from pprint import pprint
# Replace with your GitHub personal access token
GITHUB_TOKEN = "----------------------"
def search_pull_requests_with_label(repo, label):
url = f"https://api.github.com/search/issues"
query = f"repo:{repo} is:pr label:{label}"
params = {
@aojea
aojea / README.md
Last active January 9, 2025 18:25
Expose cluster domain to pods
@aojea
aojea / kindnet-gke.yaml
Last active January 14, 2025 17:47
Use kindnet in GKE
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: kindnet
rules:
- apiGroups:
- ""
resources:
- nodes
@aojea
aojea / dump.go
Last active January 4, 2025 22:05
golang nftables dump go objects
package main
import (
"fmt"
"log"
"os"
"github.com/google/nftables"
)
@aojea
aojea / 1.20--1.21.txt
Last active November 28, 2024 15:23
Kubernetes client-go apidiff
- ./kubernetes/typed/certificates/v1.CertificateSigningRequestInterface.Apply: added
- ./kubernetes/typed/certificates/v1.CertificateSigningRequestInterface.ApplyStatus: added
- ./kubernetes/typed/rbac/v1.ClusterRoleBindingInterface.Apply: added
- ./kubernetes/typed/rbac/v1.ClusterRoleInterface.Apply: added
- ./kubernetes/typed/rbac/v1.RoleBindingInterface.Apply: added
- ./kubernetes/typed/rbac/v1.RoleInterface.Apply: added
- ./kubernetes/typed/apiserverinternal/v1alpha1.StorageVersionInterface.Apply: added
- ./kubernetes/typed/apiserverinternal/v1alpha1.StorageVersionInterface.ApplyStatus: added
- ./informers/storage/v1beta1.Interface.CSIStorageCapacities: added
- ./informers/policy.Interface.V1: added
for i in $(grep -rl '<<<<<<<' path/to/go/module/); do sed -i '/=======/,/>>>>>>>/d' $i ; sed -i '/<<<<<<</d' $i; done
@aojea
aojea / .config
Last active September 18, 2024 09:11
kernel config networking tests
#
# Automatically generated file; DO NOT EDIT.
# Linux/x86 6.11.0 Kernel Configuration
#
CONFIG_CC_VERSION_TEXT="gcc (Debian 13.2.0-13) 13.2.0"
CONFIG_CC_IS_GCC=y
CONFIG_GCC_VERSION=130200
CONFIG_CLANG_VERSION=0
CONFIG_AS_IS_GNU=y
CONFIG_AS_VERSION=24200