This file contains hidden or 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": "v1beta2", | |
"desiredState": { | |
"manifest": { | |
"containers": [ | |
{ | |
"image": "kubernetes/pause", | |
"name": "hello-container1", | |
"ports": [ | |
{ |
This file contains hidden or 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
#define _GNU_SOURCE | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <sched.h> | |
#include <errno.h> | |
#include <sys/mount.h> | |
#include <sys/types.h> | |
#include <fcntl.h> | |
#include <sys/stat.h> | |
#include <unistd.h> |
This file contains hidden or 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
package system_test | |
import ( | |
"io/ioutil" | |
"os" | |
"testing" | |
"github.com/docker/libcontainer/system" | |
"github.com/docker/libcontainer/selinux" | |
) |
This file contains hidden or 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
set -x | |
network_ip=10.1.0.0/16 | |
tap_ip=10.1.0.1 | |
new_ip=$1 | |
net_container=$(docker run -d kubernetes/pause) | |
echo $net_container | |
pid=$(docker inspect --format "{{.State.Pid}}" ${net_container}) | |
ipaddr=$(docker inspect --format "{{.NetworkSettings.IPAddress}}" ${net_container}) |
This file contains hidden or 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
1. Setup a Fedora 21 VM using virt-builder and import into virt-manager. | |
2. Download and compile https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.19.tar.xz with CONFIG_IPVLAN=m. | |
3. Copy the kernel to /boot and add it to grub using grub2-mkconfig and dracut. Reboot. | |
4. Steps from https://github.com/torvalds/linux/blob/master/Documentation/networking/ipvlan.txt with additional comments -- | |
(a) Create two network namespaces - ns0, ns1 | |
ip netns add ns0 | |
ip netns add ns1 | |
(b) Create two ipvlan slaves on eth0 (master device) | |
ip link add link eth0 ipvl0 type ipvlan mode l2 |
This file contains hidden or 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
package main | |
import ( | |
"fmt" | |
"log" | |
docker "github.com/fsouza/go-dockerclient" | |
) | |
func main() { |
This file contains hidden or 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@localhost ~]# ovs-vsctl show | |
60741b68-4d89-4cee-989c-1e5a7718731e | |
Bridge "br0" | |
fail_mode: secure | |
Port vethd | |
Interface vethd | |
Port vethc | |
Interface vethc | |
Port "vxlan0" | |
Interface "vxlan0" |
This file contains hidden or 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
2014/07/30 15:00:44 Command started | |
sh-4.2# mount -t proc proc /proc | |
sh-4.2# cat /proc/self/uid_map | |
0 1000 1 | |
sh-4.2# cat /proc/self/gid_map | |
0 1000 1 | |
sh-4.2# ps -ef | |
UID PID PPID C STIME TTY TIME CMD | |
root 1 0 0 15:00 pts/6 00:00:00 /bin/sh | |
root 5 1 0 15:01 pts/6 00:00:00 ps -ef |
This file contains hidden or 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
package main | |
import ( | |
"log" | |
"os" | |
"os/exec" | |
"syscall" | |
) | |
func main() { |
This file contains hidden or 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 -r 9895f9e36435 src/pkg/syscall/exec_linux.go | |
--- a/src/pkg/syscall/exec_linux.go Thu Jun 19 10:20:01 2014 +1000 | |
+++ b/src/pkg/syscall/exec_linux.go Wed Jul 30 14:03:39 2014 -0400 | |
@@ -36,7 +36,7 @@ | |
// For the same reason compiler does not race instrument it. | |
// The calls to RawSyscall are okay because they are assembly | |
// functions that do not grow the stack. | |
-func forkAndExecInChild(argv0 *byte, argv, envv []*byte, chroot, dir *byte, attr *ProcAttr, sys *SysProcAttr, pipe int) (pid int, err Errno) { | |
+func forkAndExecInChild(argv0 *byte, argv, envv []*byte, chroot, dir *byte, attr *ProcAttr, sys *SysProcAttr, child, parent int) (pid int, err Errno) { | |
// Declare all variables at top in case any |