aboutsummaryrefslogtreecommitdiffstats
path: root/internal/pkg/node
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 /internal/pkg/node
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 'internal/pkg/node')
-rw-r--r--internal/pkg/node/node.go31
1 files changed, 31 insertions, 0 deletions
diff --git a/internal/pkg/node/node.go b/internal/pkg/node/node.go
new file mode 100644
index 0000000..e989e07
--- /dev/null
+++ b/internal/pkg/node/node.go
@@ -0,0 +1,31 @@
+package node
+
+import (
+ "ovn4nfv-k8s-plugin/internal/pkg/ovn"
+
+ logf "sigs.k8s.io/controller-runtime/pkg/runtime/log"
+)
+
+var log = logf.Log.WithName("node")
+
+//AddNodeLogicalPorts return nodeIntfMacAddr and nodeIntfIPAddr
+func AddNodeLogicalPorts(node string) (nodeIntfMacAddr, nodeIntfIPAddr string, err error) {
+ ovnCtl, err := ovn.GetOvnController()
+ if err != nil {
+ return "", "", err
+ }
+
+ log.Info("Calling CreateNodeLogicalPorts")
+ nodeIntfMacAddr, nodeIntfIPAddr, err = ovnCtl.AddNodeLogicalPorts(node)
+ if err != nil {
+ return "", "", err
+ }
+ return nodeIntfMacAddr, nodeIntfIPAddr, nil
+}
+
+//DeleteNodeLogicalPorts return nil
+func DeleteNodeLogicalPorts(name, namesapce string) error {
+ // Run delete for all controllers;
+ // Todo
+ return nil
+}