github.com/kubernetes-incubator/cri-o/server/sandbox.go
RunPodSandbox()
oci.NewContainer()
s.runtime.CreateContainer()
s.netPlugin.SetUpPod(netnsPath, podNamespace, id, containerName)
s.runtime.StartContainer()
github.com/rajatchopra/ocicni/ocicni.go
View gist:a855e336f5ba161d7ebf724f9802ea25
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 /etc/ocid.conf | |
[ocid.runtime] | |
runtime="/usr/local/sbin/runc" | |
$ cat /etc/cni/net.d/10-mynet.conf | |
{ | |
"cniVersion": "0.2.0", | |
"name": "mynet", | |
"type": "bridge", | |
"bridge": "cni0", |
View gist:988dc61f936f08bf905876daf46a38a0
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
CNI spec: https://github.com/containernetworking/cni/blob/master/SPEC.md | |
CNI flannel plugin: https://github.com/containernetworking/cni/blob/master/Documentation/flannel.md | |
Flannel: https://github.com/coreos/flannel | |
Flannel blog entry: https://coreos.com/blog/introducing-rudder/ | |
Main CNI plugins: https://github.com/containernetworking/cni/tree/master/plugins/main | |
CNI APIs: https://github.com/containernetworking/cni/blob/master/libcni/api.go | |
CNI Go interface: https://github.com/containernetworking/cni/blob/master/libcni/api.go#L37 | |
OCI CNI Go package: https://github.com/rajatchopra/ocicni (Used by CRI-O) |
View CRI-O_network_setup_flow.md
View How to find veth peers
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
root@netnode:/# ip link show dev phy-br-eth2 | |
8: phy-br-eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT qlen 1000 | |
link/ether 82:a4:31:98:d2:f3 brd ff:ff:ff:ff:ff:ff | |
root@netnode:/# ip link show dev int-br-eth2 | |
9: int-br-eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT qlen 1000 | |
link/ether c6:60:28:48:4f:7d brd ff:ff:ff:ff:ff:ff |
View CNI Bridge plugin
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 /etc/cni/net.d/10-mynet.conf | |
{ | |
"cniVersion": "0.2.0", | |
"name": "mynet", | |
"type": "bridge", | |
"bridge": "cni0", | |
"isGateway": true, | |
"ipMasq": true, | |
"ipam": { | |
"type": "host-local", |
View CRI-O clear
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
#!/bin/bash | |
printf "Killing all Docker containers..." | |
docker rm -f $(sudo docker ps -a -q) 2> /dev/null | |
printf "Done\n" | |
printf "Killing all runC containers..." | |
for i in `runc list -q`; do | |
runc kill $i SIGKILL 2> /dev/null | |
runc delete $i; |
View gist:d49c50772d616ae00e96c9967e676976
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
From http://unix.stackexchange.com/questions/33381/getting-information-about-a-process-memory-usage-from-proc-pid-smaps | |
For a given process in /proc/<pid>/smaps, for a given mapping entry what are: | |
Shared_Clean | |
Shared_Dirty | |
Private_Clean | |
Private_Dirty | |
View gist:2faca7841fca6caf5240b75e8f6a2d58
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
diff --git a/src/hypervisor.c b/src/hypervisor.c | |
index 24f7c85..9aedf04 100644 | |
--- a/src/hypervisor.c | |
+++ b/src/hypervisor.c | |
@@ -90,7 +90,7 @@ out: | |
* Use a pci slot available on that bus after adding an offset to take | |
* into account busy slots and the slots used earlier in our qemu options. | |
*/ | |
-#define QEMU_FMT_DEVICE "driver=virtio-net-pci,bus=/pci-lite-host/pcie.0,addr=%x,netdev=%s" | |
+#define QEMU_FMT_DEVICE "driver=virtio-net-pci,bus=/q35-pcihost/pcie.0,addr=%x,netdev=%s" |
View kubeadm-cheat-sheet.md
Create an nginx pod:
kubectl run nginx --image=nginx --port=80 --replicas=3
kubectl expose deployment nginx --port=80
kubectl run busybox-fail --rm -ti --image=busybox /bin/sh
kubectl run busybox --image=busybox --command -- sleep 600
kubectl expose deployment my-nginx --port=80 --type=NodePort
kubectl get svc
kubectl describe service my-nginx
OlderNewer