Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Route added for pod_cidr to handle k8s probe in multi interface nodes
In mulitple interfaces nodes, kubelet may use mgmt interface
and vrouter may use the control data interface. If the default gw
is mgmt, kubelet probes wont go via vrouter. Added route for pod_cidr
to go via vhost0.

Change-Id: If74f7bfbc7cb3d03f43a7bd5003a5f85ba513c8f
Closes-bug: 1767094
  • Loading branch information
ymariappan committed Aug 10, 2018
1 parent 49e3600 commit 68ab08c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions containers/vrouter/agent/entrypoint.sh
Expand Up @@ -98,6 +98,11 @@ else
pci_address=`cat $binding_data_dir/${phys_int}_pci`
fi

if [ "$CLOUD_ORCHESTRATOR" == "kubernetes" ] && [ ! -z $VROUTER_GATEWAY ]; then
# dont need k8s_pod_cidr_route if default gateway is vhost0
add_k8s_pod_cidr_route
fi

VROUTER_GATEWAY=${VROUTER_GATEWAY:-`get_default_gateway_for_nic 'vhost0'`}
vrouter_cidr=$(get_cidr_for_nic 'vhost0')
echo "INFO: Physical interface: $phys_int, mac=$phys_int_mac, pci=$pci_address"
Expand Down
5 changes: 5 additions & 0 deletions containers/vrouter/base/agent-functions.sh
Expand Up @@ -744,3 +744,8 @@ function check_and_launch_dhcp_clients() {
echo "WARNING: dhcp clients not running for vhost0. If this is not static configuration, connectivity will be lost"
fi
}

function add_k8s_pod_cidr_route() {
local pod_cidr=${KUBERNETES_POD_SUBNETS:-"10.32.0.0/12"}
ip route add $pod_cidr via $VROUTER_GATEWAY dev vhost0
}

0 comments on commit 68ab08c

Please sign in to comment.