Written by @jrfastab for our talk at KubeCon Paris on eBPF Abilities
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo docker run -v /sys/fs/bpf:/sys/fs/bpf --privileged --net=host cilium/cilium:stable cilium cleanup -f --all-state |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: rbac.authorization.k8s.io/v1 | |
kind: Role | |
metadata: | |
namespace: default | |
name: pod-runner | |
rules: | |
- apiGroups: [""] # "" indicates the core API group | |
resources: ["pods"] | |
verbs: ["create", "delete", "get", "watch", "list"] | |
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<script src="https://unpkg.com/axios/dist/axios.min.js"></script> | |
</head> | |
<body> | |
<p>Project <span id="repo">aquasecurity/trivy</span> <span id="starcount"></span></p> | |
</body> | |
<script> | |
function getStarcount(repo, resultElement) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": { | |
"title": "Full Name", | |
"type": "string", | |
"githubKey": "name" | |
}, | |
"email": { | |
"title": "E-Mail", | |
"type": "string", | |
"githubKey": "email", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func main() { | |
x := 1 | |
f := func() { | |
fmt.Printf("x is %d\n", x) | |
} | |
x = 2 | |
f() | |
} |
I hereby irrevocably assign all of my right, title and interest in and to my past, present and future contributions to the Name of project Open Source project (“Contributions”) to Recipient, and irrevocably waive and release all rights and claims in respect thereof (including all moral rights or similar rights), without the right to receive any compensation or royalties.
I hereby represent and warrant that I am the sole author of the Contributions, which are my original creations, that I have the legal right to make the assignment set forth above, and that no Contributions are subject to any claim of ownership or otherwise by my employer or any other organization with which I may be affiliated in any way.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
from bcc import BPF | |
from time import sleep | |
# This outputs a count of how many times the clone and execve syscalls have been made | |
# showing the use of an eBPF map (called syscall). | |
program = """ | |
BPF_HASH(syscall); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cat Vagrantfile | |
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
$script = <<-SCRIPT | |
cat > /etc/docker/daemon.json << EOF | |
{ | |
"insecure-registries": [ | |
"172.30.0.0/16" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# After loading this | |
# Install a pod network | |
# $ kubectl apply -f https://cloud.weave.works/k8s/net?k8s-version=$(kubectl version | base64 | tr -d '\n') | |
# Allow pods to run on the master node | |
# $ kubectl taint nodes --all node-role.kubernetes.io/master- |
NewerOlder