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
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", |
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) |
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 |
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", |
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; |
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 | |
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" |
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