Selaa lähdekoodia

Rename rudder to flannel

rudder name conflicts with an existing software project and we are
renaming our project to flannel. flannel -- the container networking
fabric.
Eugene Yakubovich 10 vuotta sitten
vanhempi
commit
81dac46496
16 muutettua tiedostoa jossa 73 lisäystä ja 72 poistoa
  1. 1 1
      .gitignore
  2. 1 1
      Godeps/Godeps.json
  3. 21 21
      README.md
  4. 4 4
      backend/alloc/alloc.go
  5. 1 1
      backend/common.go
  6. 2 2
      backend/udp/cproxy.go
  7. 14 14
      backend/udp/udp.go
  8. 5 4
      build
  9. 12 12
      main.go
  10. 1 1
      pkg/ip/iface.go
  11. 1 1
      pkg/ip/tun.go
  12. 1 1
      subnet/config.go
  13. 2 2
      subnet/registry.go
  14. 4 4
      subnet/subnet.go
  15. 2 2
      subnet/subnet_test.go
  16. 1 1
      test

+ 1 - 1
.gitignore

@@ -1,3 +1,3 @@
-rudder
+flannel
 coverage
 bin

+ 1 - 1
Godeps/Godeps.json

@@ -1,5 +1,5 @@
 {
-	"ImportPath": "github.com/coreos/rudder",
+	"ImportPath": "github.com/coreos/flannel",
 	"GoVersion": "go1.2.2",
 	"Packages": [
 		"./..."

+ 21 - 21
README.md

@@ -1,6 +1,6 @@
-# Rudder
+# flannel
 
-Rudder is an overlay network that gives a subnet to each machine for use with
+flannel is an overlay network that gives a subnet to each machine for use with
 Kubernetes.
 
 In Kubernetes every machine in the cluster is assigned a full subnet. The machine A
@@ -12,7 +12,7 @@ disadvantage is that the only cloud provider that can do this is GCE.
 
 To emulate the Kubernetes model from GCE on other platforms we need to create
 an overlay network on top of the network that we are given from cloud
-providers. Rudder uses the Universal TUN/TAP device and creates an overlay network
+providers. flannel uses the Universal TUN/TAP device and creates an overlay network
 using UDP to encapsulate IP packets. The subnet allocation is done with the help
 of etcd which maintains the overlay to actual IP mappings.
 
@@ -21,21 +21,21 @@ overlay network:
 
 ![Life of a packet](./packet-01.png)
 
-## Building Rudder
+## Building flannel
 
 * Step 1: Make sure you have Linux headers installed on your machine. On Ubuntu, run ```sudo apt-get install linux-libc-dev```. On Fedora/Redhat, run ```sudo yum install kernel-headers```.
-* Step 2: Git clone the Rudder repo: ```https://github.com/coreos/rudder.git```
-* Step 3: Run the build script: ```cd rudder; ./build```
+* Step 2: Git clone the flannel repo: ```https://github.com/coreos/flannel.git```
+* Step 3: Run the build script: ```cd flannel; ./build```
 
-Alternatively, you can build rudder in a docker container with the following command. Replace $SRC with the absolute path to your rudder source code:
+Alternatively, you can build flannel in a docker container with the following command. Replace $SRC with the absolute path to your flannel source code:
 
 ```
-docker run -v $SRC:/opt/rudder -i -t google/golang /bin/bash -c "cd /opt/rudder && ./build"
+docker run -v $SRC:/opt/flannel -i -t google/golang /bin/bash -c "cd /opt/flannel && ./build"
 ```
 
 ## Configuration
 
-Rudder reads its configuration from etcd. By default, it will read the configuration
+flannel reads its configuration from etcd. By default, it will read the configuration
 from ```/coreos.com/network/config``` (can be overridden via --etcd-prefix).
 The value of the config should be a JSON dictionary with the following keys:
 
@@ -53,14 +53,14 @@ the last subnet of Network.
 
 ## Running
 
-Once you have pushed configuration JSON to etcd, you can start Rudder. If you published your
-config at the default location, you can start Rudder with no arguments. Rudder will acquire a
+Once you have pushed configuration JSON to etcd, you can start flannel. If you published your
+config at the default location, you can start flannel with no arguments. flannel will acquire a
 subnet lease, configure its routes based on other leases in the overlay network and start
 routing packets. Additionally it will monitor etcd for new members of the network and adjust
 its routing table accordingly.
 
-After Rudder has acquired the subnet and configured the TUN device, it will write out an
-environment variable file (```/run/rudder/subnet.env``` by default) with subnet address and
+After flannel has acquired the subnet and configured the TUN device, it will write out an
+environment variable file (```/run/flannel/subnet.env``` by default) with subnet address and
 MTU that it supports.
 
 ## Key command line options
@@ -70,29 +70,29 @@ MTU that it supports.
 -etcd-prefix="/coreos.com/network": etcd prefix
 -iface="": interface to use (IP or name) for inter-host communication. Defaults to the interface for the default route on the machine.
 -port=8285: UDP port to use for inter-node communications
--subnet-file="/run/rudder/subnet.env": filename where env variables (subnet and MTU values) will be written to
+-subnet-file="/run/flannel/subnet.env": filename where env variables (subnet and MTU values) will be written to
 -v=0: log level for V logs. Set to 1 to see messages related to data path
 ```
 
 ## Docker integration
 
 Docker daemon accepts ```--bip``` argument to configure the subnet of the docker0 bridge. It also accepts ```--mtu``` to set the MTU
-for docker0 and veth devices that it will be creating. Since Rudder writes out the acquired subnet and MTU values into
+for docker0 and veth devices that it will be creating. Since flannel writes out the acquired subnet and MTU values into
 a file, the script starting Docker daemon can source in the values and pass them to Docker daemon:
 
 ```bash
-source /run/rudder/subnet.env
-docker -d --bip=${RUDDER_SUBNET} --mtu=${RUDDER_MTU}
+source /run/flannel/subnet.env
+docker -d --bip=${FLANNEL_SUBNET} --mtu=${FLANNEL_MTU}
 ```
 
-Systemd users can use ```EnvironmentFile``` directive in the .service file to pull in ```/run/rudder/subnet.env```
+Systemd users can use ```EnvironmentFile``` directive in the .service file to pull in ```/run/flannel/subnet.env```
 
 ## CoreOS integration
 
-On CoreOS it is useful to add Rudder configuration into .service file in the cloud-config as the following snippet demonstrates:
+On CoreOS it is useful to add flannel configuration into .service file in the cloud-config as the following snippet demonstrates:
 
 ```
-  - name: rudder.service
+  - name: flannel.service
     command: start
     content: |
       [Unit]
@@ -101,5 +101,5 @@ On CoreOS it is useful to add Rudder configuration into .service file in the clo
 
       [Service]
       ExecStartPre=-/usr/bin/etcdctl mk /coreos.com/network/config '{"Network":"10.0.0.0/16"}'
-      ExecStart=/opt/bin/rudder
+      ExecStart=/opt/bin/flannel
 ```

+ 4 - 4
backend/alloc/alloc.go

@@ -4,10 +4,10 @@ import (
 	"fmt"
 	"net"
 
-	"github.com/coreos/rudder/backend"
-	"github.com/coreos/rudder/pkg/ip"
-	"github.com/coreos/rudder/pkg/task"
-	"github.com/coreos/rudder/subnet"
+	"github.com/coreos/flannel/backend"
+	"github.com/coreos/flannel/pkg/ip"
+	"github.com/coreos/flannel/pkg/task"
+	"github.com/coreos/flannel/subnet"
 )
 
 

+ 1 - 1
backend/common.go

@@ -3,7 +3,7 @@ package backend
 import (
 	"net"
 
-	"github.com/coreos/rudder/pkg/ip"
+	"github.com/coreos/flannel/pkg/ip"
 )
 
 type SubnetDef struct {

+ 2 - 2
backend/udp/cproxy.go

@@ -9,9 +9,9 @@ import (
 	"reflect"
 	"unsafe"
 
-	log "github.com/coreos/rudder/Godeps/_workspace/src/github.com/golang/glog"
+	log "github.com/coreos/flannel/Godeps/_workspace/src/github.com/golang/glog"
 
-	"github.com/coreos/rudder/pkg/ip"
+	"github.com/coreos/flannel/pkg/ip"
 )
 
 func runCProxy(tun *os.File, conn *net.UDPConn, ctl *os.File, tunIP ip.IP4, tunMTU int) {

+ 14 - 14
backend/udp/udp.go

@@ -9,13 +9,13 @@ import (
 	"sync"
 	"syscall"
 
-	"github.com/coreos/rudder/Godeps/_workspace/src/github.com/docker/libcontainer/netlink"
-	log "github.com/coreos/rudder/Godeps/_workspace/src/github.com/golang/glog"
+	"github.com/coreos/flannel/Godeps/_workspace/src/github.com/docker/libcontainer/netlink"
+	log "github.com/coreos/flannel/Godeps/_workspace/src/github.com/golang/glog"
 
-	"github.com/coreos/rudder/backend"
-	"github.com/coreos/rudder/pkg/ip"
-	"github.com/coreos/rudder/pkg/task"
-	"github.com/coreos/rudder/subnet"
+	"github.com/coreos/flannel/backend"
+	"github.com/coreos/flannel/pkg/ip"
+	"github.com/coreos/flannel/pkg/task"
+	"github.com/coreos/flannel/subnet"
 )
 
 const (
@@ -148,7 +148,7 @@ func (m *UdpBackend) initTun(ipMasq bool) error {
 	var tunName string
 	var err error
 
-	m.tun, tunName, err = ip.OpenTun("rudder%d")
+	m.tun, tunName, err = ip.OpenTun("flannel%d")
 	if err != nil {
 		return fmt.Errorf("Failed to open TUN device: %v", err)
 	}
@@ -206,20 +206,20 @@ func setupIpMasq(ipn ip.IP4Net, iface string) error {
 		return fmt.Errorf("failed to setup IP Masquerade. iptables was not found")
 	}
 
-	err = ipt.ClearChain("nat", "RUDDER")
+	err = ipt.ClearChain("nat", "FLANNEL")
 	if err != nil {
-		return fmt.Errorf("Failed to create/clear RUDDER chain in NAT table: %v", err)
+		return fmt.Errorf("Failed to create/clear FLANNEL chain in NAT table: %v", err)
 	}
 
 	rules := [][]string{
 		// This rule makes sure we don't NAT traffic within overlay network (e.g. coming out of docker0)
-		[]string{ "RUDDER", "-d", ipn.String(), "-j", "ACCEPT" },
+		[]string{ "FLANNEL", "-d", ipn.String(), "-j", "ACCEPT" },
 		// This rule makes sure we don't NAT multicast traffic within overlay network
-		[]string{ "RUDDER", "-d", "224.0.0.0/4", "-j", "ACCEPT" },
+		[]string{ "FLANNEL", "-d", "224.0.0.0/4", "-j", "ACCEPT" },
 		// This rule will NAT everything originating from our overlay network and 
-		[]string{ "RUDDER", "!", "-o", iface, "-j", "MASQUERADE" },
-		// This rule will take everything coming from overlay and sent it to RUDDER chain
-		[]string{ "POSTROUTING", "-s", ipn.String(), "-j", "RUDDER" },
+		[]string{ "FLANNEL", "!", "-o", iface, "-j", "MASQUERADE" },
+		// This rule will take everything coming from overlay and sent it to FLANNEL chain
+		[]string{ "POSTROUTING", "-s", ipn.String(), "-j", "FLANNEL" },
 	}
 
 	for _, args := range rules {

+ 5 - 4
build

@@ -1,7 +1,7 @@
 #!/bin/bash -e
 
 ORG_PATH="github.com/coreos"
-REPO_PATH="${ORG_PATH}/rudder"
+REPO_PATH="${ORG_PATH}/flannel"
 
 if [ ! -h gopath/src/${REPO_PATH} ]; then
 	mkdir -p gopath/src/${ORG_PATH}
@@ -14,8 +14,9 @@ export GOPATH=${PWD}/gopath
 eval $(go env)
 
 if [ ${GOOS} = "linux" ]; then
-	echo "Building rudder"
-	go install ${REPO_PATH}
+	echo "Building flanneld"
+	go build -o flanneld ${REPO_PATH}
+	mv ./flanneld $GOBIN
 else
-	echo "Not on Linux - skipping rudder build"
+	echo "Not on Linux - skipping flanneld build"
 fi

+ 12 - 12
main.go

@@ -12,15 +12,15 @@ import (
 	"syscall"
 	"time"
 
-	"github.com/coreos/rudder/Godeps/_workspace/src/github.com/coreos/go-systemd/daemon"
-	log "github.com/coreos/rudder/Godeps/_workspace/src/github.com/golang/glog"
-
-	"github.com/coreos/rudder/backend"
-	"github.com/coreos/rudder/pkg/ip"
-	"github.com/coreos/rudder/pkg/task"
-	"github.com/coreos/rudder/subnet"
-	"github.com/coreos/rudder/backend/alloc"
-	"github.com/coreos/rudder/backend/udp"
+	"github.com/coreos/flannel/Godeps/_workspace/src/github.com/coreos/go-systemd/daemon"
+	log "github.com/coreos/flannel/Godeps/_workspace/src/github.com/golang/glog"
+
+	"github.com/coreos/flannel/backend"
+	"github.com/coreos/flannel/pkg/ip"
+	"github.com/coreos/flannel/pkg/task"
+	"github.com/coreos/flannel/subnet"
+	"github.com/coreos/flannel/backend/alloc"
+	"github.com/coreos/flannel/backend/udp"
 )
 
 type CmdLineOpts struct {
@@ -38,7 +38,7 @@ var opts CmdLineOpts
 func init() {
 	flag.StringVar(&opts.etcdEndpoint, "etcd-endpoint", "http://127.0.0.1:4001", "etcd endpoint")
 	flag.StringVar(&opts.etcdPrefix, "etcd-prefix", "/coreos.com/network", "etcd prefix")
-	flag.StringVar(&opts.subnetFile, "subnet-file", "/run/rudder/subnet.env", "filename where env variables (subnet and MTU values) will be written to")
+	flag.StringVar(&opts.subnetFile, "subnet-file", "/run/flannel/subnet.env", "filename where env variables (subnet and MTU values) will be written to")
 	flag.StringVar(&opts.iface, "iface", "", "interface to use (IP or name) for inter-host communication")
 	flag.BoolVar(&opts.ipMasq, "ip-masq", false, "setup IP masquerade rule for traffic destined outside of overlay network")
 	flag.BoolVar(&opts.help, "help", false, "print this message")
@@ -59,10 +59,10 @@ func writeSubnetFile(sn *backend.SubnetDef) error {
 	}
 	defer f.Close()
 
-	if _, err = fmt.Fprintf(f, "RUDDER_SUBNET=%s\n", sn.Net); err != nil {
+	if _, err = fmt.Fprintf(f, "FLANNEL_SUBNET=%s\n", sn.Net); err != nil {
 		return err
 	}
-	if _, err = fmt.Fprintf(f, "RUDDER_MTU=%d\n", sn.MTU); err != nil {
+	if _, err = fmt.Fprintf(f, "FLANNEL_MTU=%d\n", sn.MTU); err != nil {
 		return err
 	}
 	return nil

+ 1 - 1
pkg/ip/iface.go

@@ -4,7 +4,7 @@ import (
 	"errors"
 	"net"
 
-	"github.com/coreos/rudder/Godeps/_workspace/src/github.com/docker/libcontainer/netlink"
+	"github.com/coreos/flannel/Godeps/_workspace/src/github.com/docker/libcontainer/netlink"
 )
 
 func GetIfaceIP4Addr(iface *net.Interface) (net.IP, error) {

+ 1 - 1
pkg/ip/tun.go

@@ -7,7 +7,7 @@ import (
 	"syscall"
 	"unsafe"
 
-	"github.com/coreos/rudder/Godeps/_workspace/src/github.com/docker/libcontainer/netlink"
+	"github.com/coreos/flannel/Godeps/_workspace/src/github.com/docker/libcontainer/netlink"
 )
 
 const (

+ 1 - 1
subnet/config.go

@@ -4,7 +4,7 @@ import (
 	"encoding/json"
 	"errors"
 
-	"github.com/coreos/rudder/pkg/ip"
+	"github.com/coreos/flannel/pkg/ip"
 )
 
 type Config struct {

+ 2 - 2
subnet/registry.go

@@ -5,8 +5,8 @@ import (
 	"time"
 	"path"
 
-	"github.com/coreos/rudder/Godeps/_workspace/src/github.com/coreos/go-etcd/etcd"
-	log "github.com/coreos/rudder/Godeps/_workspace/src/github.com/golang/glog"
+	"github.com/coreos/flannel/Godeps/_workspace/src/github.com/coreos/go-etcd/etcd"
+	log "github.com/coreos/flannel/Godeps/_workspace/src/github.com/golang/glog"
 )
 
 type subnetRegistry interface {

+ 4 - 4
subnet/subnet.go

@@ -9,11 +9,11 @@ import (
 	"strconv"
 	"time"
 
-	"github.com/coreos/rudder/Godeps/_workspace/src/github.com/coreos/go-etcd/etcd"
-	log "github.com/coreos/rudder/Godeps/_workspace/src/github.com/golang/glog"
+	"github.com/coreos/flannel/Godeps/_workspace/src/github.com/coreos/go-etcd/etcd"
+	log "github.com/coreos/flannel/Godeps/_workspace/src/github.com/golang/glog"
 
-	"github.com/coreos/rudder/pkg/ip"
-	"github.com/coreos/rudder/pkg/task"
+	"github.com/coreos/flannel/pkg/ip"
+	"github.com/coreos/flannel/pkg/task"
 )
 
 const (

+ 2 - 2
subnet/subnet_test.go

@@ -5,9 +5,9 @@ import (
 	"testing"
 	"time"
 
-	"github.com/coreos/rudder/Godeps/_workspace/src/github.com/coreos/go-etcd/etcd"
+	"github.com/coreos/flannel/Godeps/_workspace/src/github.com/coreos/go-etcd/etcd"
 
-	"github.com/coreos/rudder/pkg/ip"
+	"github.com/coreos/flannel/pkg/ip"
 )
 
 type mockSubnetRegistry struct {

+ 1 - 1
test

@@ -1,6 +1,6 @@
 #!/bin/bash -e
 #
-# Run all rudder tests (not including functional)
+# Run all flannel tests (not including functional)
 #   ./test
 #   ./test -v
 #