GithubHelp home page GithubHelp logo

nanopack / portal Goto Github PK

View Code? Open in Web Editor NEW
103.0 13.0 11.0 292 KB

An api-driven, in-kernel layer 2/3 load balancer.

License: MIT License

Go 99.41% Shell 0.59%
golang balancer proxy nanobox load-balancer devops developer-tools devtools nanopack

portal's Introduction

nanopack

Hub for nanopack resources and content

portal's People

Contributors

danhunsaker avatar glinton avatar rgoomar avatar sdomino avatar tolmark12 avatar tylerflint avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

portal's Issues

Firewall blocking router ports

By default, portal should allow traffic in on the configured router ports (default 80/443). Workaround for now is registering the router as a service listening on ports 80 and 443 with "127.0.0.1" as the server ip.

Add health check to load balancer

This can bed defined by url and expected response code/body/header, but should remove the container from the rotation. Once healthy, it can be added back in.

CLI

CLI to interact with the daemon.

Create/Remove services

Add new services into the ipvs system
Service needs to have an ip address, port, scheduler (round robin, weighted round robin, least connected, ...), and protocol (tcp, udp)

Add/Remove Servers

Add/remove servers from registered services. This will require host and port.

Sync services and servers

Synchronize the rules on the system with the services and servers for each service in the database

handle special characters in certs like é, ó

When a cert field has special characters like Velavi Cosméticos or Niterói portal responds with 500:{"error":"asn1: syntax error: PrintableString contains invalid character"} when attempting to register a new cert.

`PUT`ing to `/services` allows duplicates

PUT /services the following body

[
  {
    "id": "tcp-192_168_0_2-7410",
    "host": "192.168.0.2",
    "port": 7410
  },
  {
    "id": "tcp-192_168_0_2-7410",
    "host": "192.168.0.2",
    "port": 7410
  },
  {
    "id": "udp-192_168_0_2-514",
    "host": "192.168.0.2",
    "port": 514
  }
]

with nginx as the balancer causes duplicate upstream blocks to be created and nginx fails to listen. Need to ensure list of services is unique before writing to config.

Support HTTP2

Currently the only way http2 is supported is by setting a web-server (nginx), complete with certs to listen on a different port, then configuring it as a 'service'. simply adding https://<IP>:8081 as a route target isn't sufficient for the http2 upgrade.

Portal cli `-i` should not depend on server `-i`

A portal server started normally ./portal -s will generate a certificate and listen securely. When the cli tries to access portal from a machine that doesn't trust the cert, we get the following error:

$ ./portal show-services
Could not contact portal - Get https://127.0.0.1:8443/services: x509: cannot validate certificate for 127.0.0.1 because it doesn't contain any IP SANs

The server gives us this helpful logline when started with -l trace:

2016/04/07 16:24:53 http: TLS handshake error from 127.0.0.1:49473: remote error: bad certificate

We can either add the (unknown) generated cert to our trusted list and try again, or try using the -i flag to ignore the cert check. Unfortunately there is a bug:

$ ./portal show-services -i
Could not contact portal - Get http://127.0.0.1:8443/services: malformed HTTP response "\x15\x03\x01\x00\x02\x02"

# Portal server log
#2016/04/07 16:23:11 http: TLS handshake error from 127.0.0.1:49472: tls: first record does not look like a TLS handshake

Notice it tries requesting http://. Portal cli shouldn't assume that the server was started with -i just because we want to ignore the cert check.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.