Skip to content

Commit

Permalink
Merge pull request #606 from tomdee/remove-experimental-remote
Browse files Browse the repository at this point in the history
remote: Remove experimental remote support
  • Loading branch information
tomdee authored Mar 2, 2017
2 parents f5ba317 + 0786ece commit 3497516
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 2,362 deletions.
103 changes: 0 additions & 103 deletions Documentation/client-server.md

This file was deleted.

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ TAG?=$(shell git describe --tags --dirty)
ARCH?=amd64

# These variables can be overridden by setting an environment variable.
TEST_PACKAGES?=pkg/ip subnet remote
TEST_PACKAGES?=pkg/ip subnet
TEST_PACKAGES_EXPANDED=$(TEST_PACKAGES:%=github.com/coreos/flannel/%)
PACKAGES?=$(TEST_PACKAGES) network
PACKAGES_EXPANDED=$(PACKAGES:%=github.com/coreos/flannel/%)
Expand Down
19 changes: 0 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,6 @@ Additionally it will monitor etcd for new members of the network and adjust the

After flannel has acquired the subnet and configured backend, it will write out an environment variable file (`/run/flannel/subnet.env` by default) with subnet address and MTU that it supports.

## Client/Server mode (EXPERIMENTAL)

Please see [Documentation/client-server.md](https://github.com/coreos/flannel/tree/master/Documentation/client-server.md).

## Multi-network mode (EXPERIMENTAL)

Multi-network mode allows a single flannel daemon to join multiple networks.
Expand All @@ -171,16 +167,6 @@ blue.env green.env red.env
This is because some networks may initialize slower than others (or never).
Use systemd.path files for unit synchronization.

**Note**: Multi-network mode can work in conjunction with the client/server mode.
The `--networks` flag is only passed to the client:

```
# Server daemon
$ flanneld --listen=0.0.0.0:8888
# Client daemon
$ flanneld --remote=10.0.0.3:8888 --networks=blue,green
```

## Key command line options

Expand All @@ -196,11 +182,6 @@ $ flanneld --remote=10.0.0.3:8888 --networks=blue,green
--subnet-file=/run/flannel/subnet.env: filename where env variables (subnet and MTU values) will be written to.
--subnet-lease-renew-margin=60: subnet lease renewal margin, in minutes.
--ip-masq=false: setup IP masquerade for traffic destined for outside the flannel network. Flannel assumes that the default policy is ACCEPT in the NAT POSTROUTING chain.
--listen="": if specified, will run in server mode. Value is IP and port (e.g. `0.0.0.0:8888`) to listen on or `fd://` for [socket activation](http://www.freedesktop.org/software/systemd/man/systemd.socket.html).
--remote="": if specified, will run in client mode. Value is IP and port of the server.
--remote-keyfile="": SSL key file used to secure client/server communication.
--remote-certfile="": SSL certification file used to secure client/server communication.
--remote-cafile="": SSL Certificate Authority file used to secure client/server communication.
--networks="": if specified, will run in multi-network mode. Value is comma separate list of networks to join.
-v=0: log level for V logs. Set to 1 to see messages related to data path.
--version: print version and exit
Expand Down
41 changes: 8 additions & 33 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import (
"golang.org/x/net/context"

"github.com/coreos/flannel/network"
"github.com/coreos/flannel/remote"
"github.com/coreos/flannel/subnet"
"github.com/coreos/flannel/subnet/kube"
"github.com/coreos/flannel/version"
Expand All @@ -53,11 +52,6 @@ type CmdLineOpts struct {
etcdPassword string
help bool
version bool
listen string
remote string
remoteKeyfile string
remoteCertfile string
remoteCAFile string
kubeSubnetMgr bool
}

Expand All @@ -71,20 +65,12 @@ func init() {
flag.StringVar(&opts.etcdCAFile, "etcd-cafile", "", "SSL Certificate Authority file used to secure etcd communication")
flag.StringVar(&opts.etcdUsername, "etcd-username", "", "Username for BasicAuth to etcd")
flag.StringVar(&opts.etcdPassword, "etcd-password", "", "Password for BasicAuth to etcd")
flag.StringVar(&opts.listen, "listen", "", "run as server and listen on specified address (e.g. ':8080')")
flag.StringVar(&opts.remote, "remote", "", "run as client and connect to server on specified address (e.g. '10.1.2.3:8080')")
flag.StringVar(&opts.remoteKeyfile, "remote-keyfile", "", "SSL key file used to secure client/server communication")
flag.StringVar(&opts.remoteCertfile, "remote-certfile", "", "SSL certification file used to secure client/server communication")
flag.StringVar(&opts.remoteCAFile, "remote-cafile", "", "SSL Certificate Authority file used to secure client/server communication")
flag.BoolVar(&opts.kubeSubnetMgr, "kube-subnet-mgr", false, "Contact the Kubernetes API for subnet assignement instead of etcd or flannel-server.")
flag.BoolVar(&opts.help, "help", false, "print this message")
flag.BoolVar(&opts.version, "version", false, "print version and exit")
}

func newSubnetManager() (subnet.Manager, error) {
if opts.remote != "" {
return remote.NewRemoteManager(opts.remote, opts.remoteCAFile, opts.remoteCertfile, opts.remoteKeyfile)
}
if opts.kubeSubnetMgr {
return kube.NewSubnetManager()
}
Expand Down Expand Up @@ -138,25 +124,14 @@ func main() {

var runFunc func(ctx context.Context)

if opts.listen != "" {
if opts.remote != "" {
log.Error("--listen and --remote are mutually exclusive")
os.Exit(1)
}
log.Info("running as server")
runFunc = func(ctx context.Context) {
remote.RunServer(ctx, sm, opts.listen, opts.remoteCAFile, opts.remoteCertfile, opts.remoteKeyfile)
}
} else {
nm, err := network.NewNetworkManager(ctx, sm)
if err != nil {
log.Error("Failed to create NetworkManager: ", err)
os.Exit(1)
}

runFunc = func(ctx context.Context) {
nm.Run(ctx)
}
nm, err := network.NewNetworkManager(ctx, sm)
if err != nil {
log.Error("Failed to create NetworkManager: ", err)
os.Exit(1)
}

runFunc = func(ctx context.Context) {
nm.Run(ctx)
}

wg := sync.WaitGroup{}
Expand Down
Loading

0 comments on commit 3497516

Please sign in to comment.