ipvs-elector

module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 26, 2019 License: Apache-2.0

README

Build Status codecov Docker Pulls Hex.pm

IPVS Elector

Implementing the IPVS ARP leader election in Kubernetes, if the node leading, it will be sending replies in response to received ARP requests that resolve local target IP addresses. The IPVS Elector also implements a failover mechanism so that a different node can take over should the current leader node fail for some reason.

Building from Source

Clone repo into your go path under $GOPATH/src:

$ git clone https://github.com/inwinstack/ipvs-elector.git $GOPATH/src/github.com/inwinstack/ipvs-elector
$ cd $GOPATH/src/github.com/inwinstack/ipvs-elector
$ dep ensure
$ make

Running

To see the app in action, run the following three commands in separate terminals:

# terminal 1
$ POD_NAME=test-1 POD_NAMESPACE=default go run cmd/main.go --kubeconfig $HOME/.kube/config --logtostderr -v=2

# terminal 2
$ POD_NAME=test-2 POD_NAMESPACE=default go run cmd/main.go --kubeconfig $HOME/.kube/config --logtostderr -v=2

# terminal 3
$ POD_NAME=test-3 POD_NAMESPACE=default go run cmd/main.go --kubeconfig $HOME/.kube/config --logtostderr -v=2

Now kill a terminal to see the changes.

Deploying elector into Kubernetes cluster

Run the following command to deploy the IPVS Elector:

$ kubectl apply -f deploy/
$ kubectl -n kube-system get po -l k8s-app=ipvs-elector -o wide

Directories

Path Synopsis
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL