Skip to content

Instantly share code, notes, and snippets.

View aojea's full-sized avatar

Antonio Ojea aojea

View GitHub Profile
@aojea
aojea / daemonset.yaml
Created December 3, 2023 16:18
Daemonset to reconcile nodes ethtool configuration
# See for more options https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: node-ethtool
namespace: kube-system
labels:
k8s-app: node-ethtool-config
spec:
selector:
@aojea
aojea / features.diff
Last active November 27, 2023 14:07
Kubernetes features evolution
diff --git a/cmd/genfeatures/genfeatures.go b/cmd/genfeatures/genfeatures.go
new file mode 100644
index 00000000000..953305e2715
--- /dev/null
+++ b/cmd/genfeatures/genfeatures.go
@@ -0,0 +1,43 @@
+/*
+Copyright 2023 The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
@aojea
aojea / hostport_deployment.yaml
Created October 19, 2023 10:46
hostport udp pods
apiVersion: apps/v1
kind: Deployment
metadata:
name: server-deployment
labels:
app: MyApp
spec:
replicas: 2
selector:
matchLabels:
@aojea
aojea / README.md
Last active December 27, 2023 02:41
Kubernetes ServiceCIDR KEP-1880
@aojea
aojea / readme.md
Created September 11, 2023 18:10
Obtain coredump from an application
kubectl get pods -A -o wide | grep dns
kube-system   kube-dns-5bfd847c64-bkkhf                           4/4     Running   0             80m   10.108.0.5    gke-vanilla-default-pool-ddebe65c-pkzw   <none>           <none>
kubectl debug -n kube-system -it kube-dns-5bfd847c64-bkkhf --image=busybox:1.28 --target=dnsmasq
Targeting container "dnsmasq". If you don't see processes from this container it may be because the container runtime doesn't support this feature.
Defaulting debug container name to debugger-qz6cb.
If you don't see a command prompt, try pressing enter.
@aojea
aojea / service_selector.yaml
Created August 27, 2023 19:05
Service selector
apiVersion: v1
kind: Pod
metadata:
name: job1
labels:
job-name: "job1"
job-index: "0"
spec:
hostNetwork: true
containers:
@aojea
aojea / netperf.yaml
Last active August 27, 2023 14:47
netperf network performance test kubernetes
apiVersion: apps/v1
kind: Deployment
metadata:
name: netperf-server
labels:
app: netperf-server
spec:
replicas: 1
selector:
matchLabels:
@aojea
aojea / README.md
Last active December 22, 2023 19:58
Test even loadbalancing

Create the deploymentn with 100 backends and one Service

kubectl apply -f backends.yaml

Run a pod to test the Service using the httptest program, that allows to specify different parameters of the http connections

./httptest -h
Usage: httpget [options] [url]
@aojea
aojea / README.md
Last active May 19, 2025 18:46
BPF cheatsheet
@aojea
aojea / README.md
Last active January 22, 2024 07:42
service loadbalancer deleteion

Service LoadBalancer deletion

Services of Type: LoadBalancer are handled by external controllers.

These controllers need to handle the infrastructure necessary to provisiong the external Loadbalancer, and use finalizers to avoid deleting the Service before all the necessary steps are done.

Kubernetes provide a reference implementation of a controller for Loadbalancers in https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/cloud-provider/controllers/service/controller.go

Example