diff --git a/.gitignore b/.gitignore index ffb1b7e2d078a32511310226ccb078332feb9069..406add7d38266a333b3c36449a34beaeea50932b 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,4 @@ cli/gosdnc # testing and configs controller/configs/testing-gosdn.toml controller/configs/development-gosdn.toml +controller/configs/containerlab-gosdn.toml diff --git a/README.md b/README.md index 2156d1c98482148ecec502d4e23abf41e1410cfa..68ef7d0b27c835ba28eb6025b63d67d66675affa 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,8 @@ # Overview -`goSDN` is also an application that will allow you to manage your multi-vendor network using one unified controller. +`goSDN` is also an application that will allow you to manage your multi-vendor +network using one unified controller. `goSDN` provides: * Model driven device representation @@ -25,7 +26,8 @@ * Multi controller environments ## Example -A simple showcase how the controller can be adressed after `make containerlab-start` is shown below: +A simple showcase how the controller can be adressed after +`make containerlab-start` is shown below:  @@ -42,9 +44,9 @@ A simple showcase how the controller can be adressed after `make containerlab-st # Concepts -The `goSDN` controllers core - also called `nucleus` - is a lightweight library that -manages principal network domains and provides southbound interface operations -for orchestrated networking devices. +The `goSDN` controllers core - also called `nucleus` - is a lightweight library +that manages principal network domains and provides southbound interface +operations for orchestrated networking devices. In addition we provide a simple Northbound-API for the controller () @@ -74,8 +76,9 @@ running `./gosdn` from the shell. # Getting Started -If you want to use the the [playground](#playground) you have to make sure you have -[containerlab](https://containerlab.dev/install/) installed on your system. +If you want to use the the [playground](#playground) you have to make sure you +have [containerlab](https://containerlab.dev/install/) installed on your +system. ## Playground @@ -86,9 +89,16 @@ The environment contains two [Arista cEOS](https://www.arista.com/en/products/software-controlled-container-networking), a goSDN, a cSBI orchestrator and a gNMI target. -> If you're a member of the danet group you should have access to the containers repo. Don't forget to `docker login registry.code.fbi.h-da.de` +> If you're a member of the danet group you should have access to the +> containers repo. Don't forget to `sudo docker login +> registry.code.fbi.h-da.de` (`sudo` is necessary since `containerlab` has to +> be run with it and therefore a normal `docker login` wouldn't be recognized +> by it.) > -> If you're no member of the danet group you have to [create an account](https://www.arista.com/en/login) at Arista and download the Arista cEOS image by yourself. Don't forget to change the image name (line `11` in the `gosdn.clab.yml` file) to the local one you've downloaded. +> If you're no member of the danet group you have to [create an +> account](https://www.arista.com/en/login) at Arista and download the Arista +> cEOS image by yourself. Don't forget to change the image name (line `11` in +> the `gosdn.clab.yml` file) to the local one you've downloaded. ```sh # starts the containerlab topology which contains two Arista cEOS, an cSBI orchestrator, a goSDN controller and gNMI target. diff --git a/controller/Dockerfile b/controller/Dockerfile index 27f73f92aa79257f63682cdae0b0e0a4c744d142..0dd6c87560f54991fa895628fe0b6a4241d9dd97 100644 --- a/controller/Dockerfile +++ b/controller/Dockerfile @@ -12,10 +12,7 @@ FROM installer as builder COPY . . RUN make build -#FROM scratch as gosdn -#COPY --from=builder /gosdn/artifacts/gosdn / -#ENTRYPOINT ["/gosdn"] - FROM builder as gosdn COPY controller/configs/development-gosdn.toml.example /gosdn/configs/development-gosdn.toml +COPY controller/configs/containerlab-gosdn.toml.example /gosdn/configs/containerlab-gosdn.toml ENTRYPOINT ["/gosdn/artifacts/gosdn"] diff --git a/controller/cmd/root.go b/controller/cmd/root.go index d56e963cfc96c6082743c777a5dc0f646b7e5d07..c1dad9408d8bf117674ef1474890c86dd357de94 100644 --- a/controller/cmd/root.go +++ b/controller/cmd/root.go @@ -47,7 +47,7 @@ import ( var cfgFile string var loglevel string -var grpcPort string +var socket string var csbiOrchestrator string var pluginFolder string var security string @@ -80,7 +80,7 @@ func init() { rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is ./configs/gosdn.toml)") rootCmd.PersistentFlags().StringVarP(&loglevel, "log-level", "l", "", "log level 'debug' or 'trace'") - rootCmd.Flags().StringVar(&grpcPort, "grpc-port", "", "port for gRPC NBI") + rootCmd.Flags().StringVar(&socket, "socket", "", "port for the controllers gRPC northbound interface") rootCmd.Flags().StringVar(&csbiOrchestrator, "csbi-orchestrator", "", "csbi orchestrator address") rootCmd.Flags().StringVar(&pluginFolder, "plugin-folder", "", "folder holding all goSDN specific plugins") rootCmd.Flags().StringVarP(&security, "security", "s", "", "security level 'secure' or 'insecure'") diff --git a/controller/configs/clients.toml b/controller/configs/clients.toml deleted file mode 100644 index ef551bf2ed1f85fb42a152bea10da5586c48726a..0000000000000000000000000000000000000000 --- a/controller/configs/clients.toml +++ /dev/null @@ -1,5 +0,0 @@ -[[client]] -identifier = "ciena-mcp" -endpoint = "172.17.0.3:8080" -gjsonDefaultPath = "data.#.object_data.tapi-object-data" -gjsonConnectionsPath = "data.#.object_data" diff --git a/controller/configs/containerlab-gosdn.toml.example b/controller/configs/containerlab-gosdn.toml.example new file mode 100644 index 0000000000000000000000000000000000000000..0a7a31bfe8b19c0a779c42fd3d26af6737acbb35 --- /dev/null +++ b/controller/configs/containerlab-gosdn.toml.example @@ -0,0 +1,13 @@ +basepnduuid = "5f20f34b-cbd0-4511-9ddc-c50cf6a3b49d" +basesouthboundtype = 1 +basesouthbounduuid = "ca29311a-3b17-4385-96f8-515b602a97ac" +cli_pnd = "0455b241-5863-4660-ad15-dfde7617738e" +cli_sbi = "a249f2d2-f7da-481d-8a99-b7f11471e0af" +csbi-orchestrator = "clab-gosdn_csbi_arista_base-csbi-orchestrator:55056" +help = false +plugin-folder = "plugins" +log-level = "debug" +pnduuid = "bf8160d4-4659-4a1b-98fd-f409a04111ec" +socket = ":55055" +databaseConnection = "mongodb://root:example@clab-gosdn_csbi_arista_base-mongodb:27017" + diff --git a/controller/configs/development-gosdn.toml.example b/controller/configs/development-gosdn.toml.example index a5905297427eb70e3799ce15acfb27f095f649ec..60f125602db6e8426f950aaf4daa0c006b2d14c7 100644 --- a/controller/configs/development-gosdn.toml.example +++ b/controller/configs/development-gosdn.toml.example @@ -3,10 +3,9 @@ basesouthboundtype = 1 basesouthbounduuid = "ca29311a-3b17-4385-96f8-515b602a97ac" cli_pnd = "0455b241-5863-4660-ad15-dfde7617738e" cli_sbi = "a249f2d2-f7da-481d-8a99-b7f11471e0af" -config = "" csbi-orchestrator = "localhost:55056" -grpc-port = "" help = false +plugin-folder = "plugins" log-level = "debug" pnduuid = "bf8160d4-4659-4a1b-98fd-f409a04111ec" socket = ":55055" diff --git a/controller/configs/gosdn.toml b/controller/configs/gosdn.toml index ee511700609ea2f2b30567b5d5af26d74e75fa0b..dc3060edb5bc4e149db44bf275b7c85b4e487e48 100644 --- a/controller/configs/gosdn.toml +++ b/controller/configs/gosdn.toml @@ -3,10 +3,9 @@ basesouthboundtype = 1 basesouthbounduuid = "ca29311a-3b17-4385-96f8-515b602a97ac" cli_pnd = "0455b241-5863-4660-ad15-dfde7617738e" cli_sbi = "a249f2d2-f7da-481d-8a99-b7f11471e0af" -config = "" csbi-orchestrator = "localhost:55056" -grpc-port = "" help = false +plugin-folder = "plugins" log-level = "debug" pnduuid = "bf8160d4-4659-4a1b-98fd-f409a04111ec" socket = ":55055" diff --git a/gosdn.clab.yaml b/gosdn.clab.yaml index 8a4e239d8094e2904d6e3a712f1b06de348fa662..407f9d8ccf13bb2bcf8ea92b2f019abb259564de 100644 --- a/gosdn.clab.yaml +++ b/gosdn.clab.yaml @@ -36,8 +36,7 @@ topology: - 8080:8080 - 40000:40000 cmd: - --config /gosdn/configs/development-gosdn.toml - --csbi-orchestrator clab-gosdn_csbi_arista_base-csbi-orchestrator:55056 + --config /gosdn/configs/containerlab-gosdn.toml mgmt_ipv4: 172.100.0.5 gnmi-target: kind: linux @@ -88,8 +87,9 @@ topology: ports: - 8081:8081 env: - MONGO_INITDB_ROOT_USERNAME: root - MONGO_INITDB_ROOT_PASSWORD: example + ME_CONFIG_MONGODB_ADMINUSERNAME: root + ME_CONFIG_MONGODB_ADMINPASSWORD: example + ME_CONFIG_MONGODB_SERVER: mongodb mgmt_ipv4: 172.100.0.14 links: