aboutsummaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorKuralamudhan Ramakrishnan <kuralamudhan.ramakrishnan@intel.com>2020-07-06 16:10:19 -0700
committerKuralamudhan Ramakrishnan <kuralamudhan.ramakrishnan@intel.com>2020-09-17 16:25:10 -0700
commitce14abc0128d4c55a7805c52ea199e2ce6159428 (patch)
tree569f74510b497ed44814e931a4667de73d133ab0 /build
parent3de63ee756f9d7c0a4524b40a89e92b918a9249f (diff)
Adding node interface, SNAT and OVN Node switch port
- Adding nfn proto for node interface MAC and IP address - Adding node switch ports in NFN Operator - Adding grpc client in nfn agent to get mac and IP address for node interface - Adding feature to create Node interface with OVS internal port - Make sure pod controller requeue the pod request for empty node field in pod spec - Unique node interface name using SHA and maintain 15 charactor for OVS switch port - Adding SNAT for default interface in each node - Adding iptables modules for SNAT rules Signed-off-by: Kuralamudhan Ramakrishnan <kuralamudhan.ramakrishnan@intel.com> Change-Id: I6cfa36e45007e796eb651345f9f0751329defcf7
Diffstat (limited to 'build')
-rw-r--r--build/Dockerfile2
-rwxr-xr-xbuild/bin/entrypoint10
2 files changed, 11 insertions, 1 deletions
diff --git a/build/Dockerfile b/build/Dockerfile
index af88d13..eefdeb3 100644
--- a/build/Dockerfile
+++ b/build/Dockerfile
@@ -7,7 +7,7 @@ ENV http_proxy $HTTP_PROXY
ENV https_proxy $HTTPS_PROXY
ENV no_proxy $NO_PROXY
-RUN apt-get update && apt-get install -y -qq apt-transport-https make curl net-tools iproute2 \
+RUN apt-get update && apt-get install -y -qq apt-transport-https make curl net-tools iproute2 iptables \
wget software-properties-common setpriv dpkg-dev netcat jq
RUN mkdir -p /opt/ovn4nfv-k8s-plugin/dist/ubuntu/deb
diff --git a/build/bin/entrypoint b/build/bin/entrypoint
index c9646a0..b8ac7db 100755
--- a/build/bin/entrypoint
+++ b/build/bin/entrypoint
@@ -66,6 +66,15 @@ install_cni_plugins() {
rm -rf cni-plugins-linux-$IMAGE_ARC-$CNI_VERSION.tgz
}
+set_snat_default_inteface() {
+ default_interface=$(awk '$2 == 00000000 { print $1 }' /proc/net/route)
+
+ # Checking the SNAT for default interfaces
+ if ! iptables -t nat -C POSTROUTING -o $default_interface -j MASQUERADE 2>/dev/null ; then
+ iptables -t nat -A POSTROUTING -o $default_interface -j MASQUERADE
+ fi
+}
+
cmd=${1:-""}
case ${cmd} in
@@ -80,6 +89,7 @@ case ${cmd} in
cp -f $OVN4NFV_BIN_FILE $CNI_BIN_DIR
cp -f $OVN4NFV_CONF_FILE $OVN4NFV_CONF_DIR
cp -f $OVN4NFV_NET_CONF_FILE $CNI_CONF_DIR
+ set_snat_default_inteface
create_kubeconfig
install_cni_plugins
# Sleep forever.