Let weaver create the bridge in weave-kube
This commit is contained in:
1 parent
3b54372eab
commit
ef9f95f653
2 files changed
+4
-13
No files matched your search
@@ -54,9 +54,6 @@ if [ "${EXPECT_NPC}" = "0" ]; then
|
|||||||
WEAVE_NPC_OPTS=""
|
WEAVE_NPC_OPTS=""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export HOST_ROOT=/host
|
|
||||||
/home/weave/weave --local create-bridge --force $WEAVE_NPC_OPTS
|
|
||||||
|
|
||||||
# Kubernetes sets HOSTNAME to the host's hostname
|
# Kubernetes sets HOSTNAME to the host's hostname
|
||||||
# when running a pod in host namespace.
|
# when running a pod in host namespace.
|
||||||
NICKNAME_ARG=""
|
NICKNAME_ARG=""
|
||||||
@@ -65,16 +62,6 @@ if [ -n "$HOSTNAME" ] ; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
BRIDGE_OPTIONS="--datapath=datapath"
|
BRIDGE_OPTIONS="--datapath=datapath"
|
||||||
if [ "$(/home/weave/weave --local bridge-type)" = "bridge" ] ; then
|
|
||||||
# TODO: Call into weave script to do this
|
|
||||||
if ! ip link show vethwe-pcap >/dev/null 2>&1 ; then
|
|
||||||
ip link add name vethwe-bridge type veth peer name vethwe-pcap
|
|
||||||
ip link set vethwe-bridge up
|
|
||||||
ip link set vethwe-pcap up
|
|
||||||
ip link set vethwe-bridge master weave
|
|
||||||
fi
|
|
||||||
BRIDGE_OPTIONS="--iface=vethwe-pcap"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -z "$KUBE_PEERS" ]; then
|
if [ -z "$KUBE_PEERS" ]; then
|
||||||
if ! KUBE_PEERS=$(/home/weave/kube-peers) || [ -z "$KUBE_PEERS" ]; then
|
if ! KUBE_PEERS=$(/home/weave/kube-peers) || [ -z "$KUBE_PEERS" ]; then
|
||||||
@@ -109,6 +96,7 @@ post_start_actions() {
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
mkdir -p $HOST_ROOT/etc/cni/net.d
|
mkdir -p $HOST_ROOT/etc/cni/net.d
|
||||||
|
export HOST_ROOT
|
||||||
/home/weave/weave --local setup-cni
|
/home/weave/weave --local setup-cni
|
||||||
|
|
||||||
# Expose the weave network so host processes can communicate with pods
|
# Expose the weave network so host processes can communicate with pods
|
||||||
@@ -118,9 +106,11 @@ post_start_actions() {
|
|||||||
post_start_actions &
|
post_start_actions &
|
||||||
|
|
||||||
/home/weave/weaver $EXTRA_ARGS --port=6783 $BRIDGE_OPTIONS \
|
/home/weave/weaver $EXTRA_ARGS --port=6783 $BRIDGE_OPTIONS \
|
||||||
|
--host-root=$HOST_ROOT \
|
||||||
--http-addr=$HTTP_ADDR --status-addr=$STATUS_ADDR --docker-api='' --no-dns \
|
--http-addr=$HTTP_ADDR --status-addr=$STATUS_ADDR --docker-api='' --no-dns \
|
||||||
--ipalloc-range=$IPALLOC_RANGE $NICKNAME_ARG \
|
--ipalloc-range=$IPALLOC_RANGE $NICKNAME_ARG \
|
||||||
--ipalloc-init $IPALLOC_INIT \
|
--ipalloc-init $IPALLOC_INIT \
|
||||||
--conn-limit=$CONN_LIMIT \
|
--conn-limit=$CONN_LIMIT \
|
||||||
|
$WEAVE_NPC_OPTS \
|
||||||
"$@" \
|
"$@" \
|
||||||
$KUBE_PEERS
|
$KUBE_PEERS
|
||||||
@@ -170,6 +170,7 @@ func main() {
|
|||||||
mflag.BoolVar(&resume, []string{"-resume"}, false, "resume connections to previous peers")
|
mflag.BoolVar(&resume, []string{"-resume"}, false, "resume connections to previous peers")
|
||||||
mflag.StringVar(&bridgeConfig.WeaveBridgeName, []string{"-weave-bridge"}, "weave", "name of weave bridge")
|
mflag.StringVar(&bridgeConfig.WeaveBridgeName, []string{"-weave-bridge"}, "weave", "name of weave bridge")
|
||||||
mflag.StringVar(&bridgeConfig.DockerBridgeName, []string{"-docker-bridge"}, "", "name of Docker bridge")
|
mflag.StringVar(&bridgeConfig.DockerBridgeName, []string{"-docker-bridge"}, "", "name of Docker bridge")
|
||||||
|
mflag.BoolVar(&bridgeConfig.ExpectNPC, []string{"-expect-npc"}, false, "set up iptables rules for npc")
|
||||||
mflag.StringVar(&routerName, []string{"#name", "-name"}, "", "name of router (defaults to MAC of interface)")
|
mflag.StringVar(&routerName, []string{"#name", "-name"}, "", "name of router (defaults to MAC of interface)")
|
||||||
mflag.StringVar(&nickName, []string{"#nickname", "-nickname"}, "", "nickname of peer (defaults to hostname)")
|
mflag.StringVar(&nickName, []string{"#nickname", "-nickname"}, "", "nickname of peer (defaults to hostname)")
|
||||||
mflag.StringVar(&password, []string{"#password", "-password"}, "", "network password")
|
mflag.StringVar(&password, []string{"#password", "-password"}, "", "network password")
|
||||||
|
|||||||
Reference in new issue
Block a user