diff options
author | Kuralamudhan Ramakrishnan <kuralamudhan.ramakrishnan@intel.com> | 2020-04-21 17:19:34 +0000 |
---|---|---|
committer | Kuralamudhan Ramakrishnan <kuralamudhan.ramakrishnan@intel.com> | 2020-09-17 16:25:10 -0700 |
commit | 3de63ee756f9d7c0a4524b40a89e92b918a9249f (patch) | |
tree | 3579bc50aee0a38d7c63c5787fca6205ced7a2df /cmd/nfn-agent/nfn-agent.go | |
parent | 7f01772cdf3916026a93e9e9ac5ce54d57401476 (diff) |
Adding cnishim and cniserver
- inspired from ovn-kubernetes and sdn openshift - cniserver & cnishim concepts
- removed cni binary to depend on the host ovs binary installation
- encapsulated all the binaries within the ovn and ovs containers
- ovn4nfv-k8s cni server run along with nfn-agent
- cnishim act as the httpclient and cniserver as httpservers
- cnishim wrap all the cni commands to cniserver
- cniserver do the actual network pumping work and send result back to cnishim
- cnishim print the results as per the cni spec requirement
- currently supports only debian installation for ovn daemon
- support for debian kernel installation
- Consolidated all yaml into single ovn4nfv-k8s-plugin
Signed-off-by: Kuralamudhan Ramakrishnan <kuralamudhan.ramakrishnan@intel.com>
Change-Id: I1e2b114d90f717baa2ee94ff379c849d73b2754e
Diffstat (limited to 'cmd/nfn-agent/nfn-agent.go')
-rw-r--r-- | cmd/nfn-agent/nfn-agent.go | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/cmd/nfn-agent/nfn-agent.go b/cmd/nfn-agent/nfn-agent.go index 3c85dbd..8d33778 100644 --- a/cmd/nfn-agent/nfn-agent.go +++ b/cmd/nfn-agent/nfn-agent.go @@ -9,8 +9,11 @@ import ( "os" "os/signal" pb "ovn4nfv-k8s-plugin/internal/pkg/nfnNotify/proto" + cs "ovn4nfv-k8s-plugin/internal/pkg/cniserver" "ovn4nfv-k8s-plugin/internal/pkg/ovn" logf "sigs.k8s.io/controller-runtime/pkg/runtime/log" + "k8s.io/client-go/kubernetes" + "k8s.io/client-go/rest" "strings" "syscall" "time" @@ -298,6 +301,26 @@ func main() { client := pb.NewNfnNotifyClient(conn) errorChannel = make(chan string) + // creates the in-cluster config + config, err := rest.InClusterConfig() + if err != nil { + log.Error(err, "Unable to create in-cluster config") + return + } + + // creates the clientset + clientset, err := kubernetes.NewForConfig(config) + if err != nil { + log.Error(err, "Unable to create clientset for in-cluster config") + return + } + + cniserver := cs.NewCNIServer("",clientset) + err = cniserver.Start(cs.HandleCNIcommandRequest) + if err != nil { + log.Error(err, "Unable to start cni server") + return + } // Run client in background go subscribeNotif(client) shutdownHandler(errorChannel) |