diff options
author | Kuralamudhan Ramakrishnan <kuralamudhan.ramakrishnan@intel.com> | 2020-07-06 16:10:19 -0700 |
---|---|---|
committer | Kuralamudhan Ramakrishnan <kuralamudhan.ramakrishnan@intel.com> | 2020-09-17 16:25:10 -0700 |
commit | ce14abc0128d4c55a7805c52ea199e2ce6159428 (patch) | |
tree | 569f74510b497ed44814e931a4667de73d133ab0 /build/bin | |
parent | 3de63ee756f9d7c0a4524b40a89e92b918a9249f (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/bin')
-rwxr-xr-x | build/bin/entrypoint | 10 |
1 files changed, 10 insertions, 0 deletions
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. |