0.0.2 • Published 5 years ago

csn-aws-provisioner v0.0.2

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
5 years ago

AWS CSN Provisioning

The AWS CSN Provisioning handles Cloud Service Network deployment in Amazon Web Services. This services heavily relies on external libraries (alkira-node-libs) to manage the lifecycle of CSN, Nodes & Peering.

This app is based on NodeJS (ExpressJS) and uses etcd as the primary storage backend. This service optionally uses Kafka to process incoming requests and propagate events to other services.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

Prior to running this project on your personal computer, you will need to install Node. Version > 8 is recommended.

Running locally (dev)

First, we need to resolve all NodeJS dependencies,

npm install

Then, we can run the application locally in dev mode (NODE_ENV=dev), make sure port 3000 is not used by another application

NODE_ENV=dev node index.js

Building the project

The application is bundled as a docker container, as such you can use the following line to build it:

docker build . -t csn-aws-provisioning

Once built, you can use the created image to start an instance of the application.

When built, the webserver will automatically start in production mode, as such you need to point it to an existing mongoDB database

Deployment

The deployment of application is currently handled by Helm and the CI server by using a pipeline.

The configuration of the application can be updated in docker-compose.yml by passing the necessary environment variables. The list of supported environment variables is:

  • PORT: Port the application is running on | default: 3000
  • ENVIRONMENT: Define the environment in which the service is running (dev, review, staging, production, ...) | No default
  • NAMESPACE: Only required when running in review mode where multiple services are deployed on the same Kubernetes cluster | No default
  • ETCD_HOST: ETCD endpoint FQDN (myetcd.alkira.net) | default: localhost
  • ETCD_PORT: ETCD endpoint port information | default: 2379
  • INTERNAL_KAFKA_BROKERS: Full kafka brokers URL (mybroker01.alkira.net:9092:mybroker02.alkira.net:9092), takes KAFKA_HOST and KAFKA_PORT precedence | default: localhost:9092
  • KAFKA_HOST: Kafka endpoint FQDN, only if behind a load balancer (for bootstrap, brokers will be discovered by client) | default: localhost
  • KAFKA_PORT: Kafka endpoint Port, only if behind a load balancer (for bootstrap, brokers will be discovered by client) | default: 9092
  • AWS_ACCESS_KEY_ID: AWS Access Key used to manage CSN | No default
  • AWS_SECRET_ACCESS_KEY: AWS Secret Key used to manage CSN| No default

Environment variables for feature flags:

  • ENABLE_AUTHORIZATION: if true, REST endpoint will enforce JWT authorization | default: false
  • ENABLE_EVENT_NOTIFICATIONS: if true, generate events to Kafka on CSN or Node lifecycle | default: false
  • ENABLE_EVENT_TRIGGERS: if true, listens to Kafka to process CSN/Node CRUD operations | default: false

License

This project is licensed under the Apache License - see the LICENSE.md file for details