cnwan-reader

command module
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 4, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

README

CN-WAN Reader

GitHub GitHub go.mod Go version

Go Report Card OpenAPI version GitHub Workflow Status GitHub release (latest semver) Docker Image Version (latest semver) DevNet published

CN-WAN Reader watches a service registry for changes and sends events to an external handler for processing.

The CN-WAN Reader is part of the Cloud Native SD-WAN (CN-WAN) project. Please check the CN-WAN documentation for the general project overview and architecture. You can contact the CN-WAN team at cnwan@cisco.com.

Overview

The CN-WAN Reader makes use of the service discovery pattern by connecting to a service registry and observing changes in published services/endpoints. Detected changes are then processed and sent as events to an adaptor, which can be created following the OpenAPI specification included in this repository.

Please follow this readme to know more about OpenAPI, Adaptors and Supported Service Registries.

Supported Service Registries

Currently, the CN-WAN Reader can discover services/endpoints published to Google Cloud's Service directory and AWS Cloud Map.

Google Cloud Service Directory

In order to connect correctly, a service account is needed. To learn more about Google Cloud Service Accounts, you can also consult this guide. Finally, you can read Service Directory's documentation to know more about how it works.

Finally, please make sure your service account has at least role roles/servicedirectory.viewer. We suggest you create service account just for the CN-WAN Reader with the aforementioned role.

AWS Cloud Map

You will need valid credentials in able to watch changes correctly.

In order to use CN-WAN Reader with Cloud Map, your IAM identity needs to have at least policy AWSCloudMapReadOnlyAccess or above.

Please note that, as of now, the reader is only able to read up to 100 services at a time and 100 instances per service. While this should more than enough for the vast majority of use-cases, if demand for supporting a higher number is there, the reader will be able to read more on next updates.

Documentation

To learn how to install or use the program, please follow documentation provided in the docs directory.

You can start by reading Installation or Docker Installation if you want to install and run the program inside a docker container.

OpenAPI Specification

The CN-WAN Reader acts as a client, sending detected changes in form of events to an external handler - an Adaptor - for processing. Therefore, any program interested in receiving and processing these events must generate the server code starting from the OpenAPI specification, or you can just implement the appropriate endpoint in your already existing server.

The specification, along with documentation on what you need to implement and what data is sent by the CN-WAN Reader, is included in this repository at this link.

To learn more about OpenAPI please take a look at this repository. To generate your code, you can use the OpenAPI Generator.

Contributing

Thank you for interest in contributing to this project. Before starting, please make sure you know and agree to our Code of conduct.

  1. Fork it
  2. Download your fork
    git clone https://github.com/your_username/cnwan-reader && cd cnwan-reader
  3. Create your feature branch
    git checkout -b my-new-feature
  4. Make changes and add them
    git add .
  5. Commit your changes
    git commit -m 'Add some feature'
  6. Push to the branch
    git push origin my-new-feature
  7. Create new pull request to this repository

License

CN-WAN Reader is released under the Apache 2.0 license. See LICENSE

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package cmd contains code that is executed by a given command from the CLI.
Package cmd contains code that is executed by a given command from the CLI.
pkg
cmd/poll
Package poll contains code and commands that detects changes to a service registry to polling mechanisms.
Package poll contains code and commands that detects changes to a service registry to polling mechanisms.
cmd/poll/cloudmap
Package cloudmap implements ways to connect to AWS CloudMap to get registrered services inside it and detects changes through a polling method.
Package cloudmap implements ways to connect to AWS CloudMap to get registrered services inside it and detects changes through a polling method.
cmd/watch
Package watch contains code watches for changes with some kind of watching mechanism, i.e.
Package watch contains code watches for changes with some kind of watching mechanism, i.e.
cmd/watch/etcd
Package etcd contains code that watches for changes in etcd.
Package etcd contains code that watches for changes in etcd.
openapi
Package openapi contains *client* code that has been auto-generated by OpenAPI generator and sends events to an external handler as specified in the OpenAPI specification included in /api.
Package openapi contains *client* code that has been auto-generated by OpenAPI generator and sends events to an external handler as specified in the OpenAPI specification included in /api.
poller
Package poller contains code that is in charge of periodically executing a given function every x seconds, where x is a customizable parameter.
Package poller contains code that is in charge of periodically executing a given function every x seconds, where x is a customizable parameter.
queue
Package queue is in charge of creating and handling a queue that receives data and sends it in bulk whenever it is possible, i.e.
Package queue is in charge of creating and handling a queue that receives data and sends it in bulk whenever it is possible, i.e.
sdhandler
Package sdhandler includes code that connects to Google Cloud Service Directory and performs different operations on its resources, such as creating a namespace, updating a service, deleting and endpoint etc.
Package sdhandler includes code that connects to Google Cloud Service Directory and performs different operations on its resources, such as creating a namespace, updating a service, deleting and endpoint etc.
services
Package services is all about handling services: from storing the latest data of a service to providing a interface for the openapi client code contained in pkg/openapi.
Package services is all about handling services: from storing the latest data of a service to providing a interface for the openapi client code contained in pkg/openapi.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL