Git Product home page Git Product logo

rpaas's Introduction

Reverse proxy service for tsuru PaaS

Deprecated in favor of https://github.com/tsuru/rpaas-operator

https://travis-ci.org/tsuru/rpaas.png?branch=master

Deploying the API

First, let's create an app in tsuru, from the project root, execute the following:

% tsuru app-create rpaas python
% git remote add tsuru [email protected]
% git push tsuru master

The push will return an error telling you that you can't push code before the app unit is up, wait until your unit is in service, you can check with:

% tsuru app-list

When you get an output like this you can proceed to push.

+-------------+-------------------------+--------------------------------------+
| Application | Units State Summary     | Address                              |
+-------------+-------------------------+--------------------------------------+
| your-app    | 1 of 1 units in-service | your-app.somewhere.com               |
+-------------+-------------------------+--------------------------------------+

Now if you access our app endpoint at "/" (you can check with tsuru app-info cmd) you should get a 404, which is right, since the API does not respond through this url.

rpaas's People

Contributors

andrestc avatar andrewsmedina avatar cezarsa avatar dependabot[bot] avatar dmvieira avatar fsouza avatar morpheu avatar nettoclaudio avatar pedrokiefer avatar ricobl avatar tarsisazevedo avatar tcarreira avatar wpjunior 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

Watchers

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

rpaas's Issues

tasks: retry tasks on failure

Since most RpaaS API operations are asynchronous , maybe its a good idea implement retry on celery tasks. Today the only way available is remove instance and create it again :(

Accept a local file

It would be nice to pass a local file to the content argument as it may contain multiline content.

show a nice msg when bind rpaas instance(already bind to an app) to another app

When we try to bind a rpaas instance that has already been binded to another one it shows me a msg and an error:

Error: Failed to bind the instance "rpaas-be-lab/teste" to the app "myapp2-static-galeb":

<title>Internal Server Error</title>

Internal Server Error

This dont tell me that it has been binded to another app.

auto healing

The API should be able to automatically heal failing instance, respawning if needed.

support EC2

We should be able to run instances and manage load balancers in Amazon EC2.

support plans

The API should support plans. A plan could define things like:

  • the IaaS (VM + load balancer)
    • including some settings on the IaaS (size of the VM, load balancing policy, etc.)
  • the reverse proxy technology (which we call "manager" today, currently only nginx is supported)
  • HTTPS support (?)

plugin: add command to force https

Currently, in order to force HTTPS, we need to do something like this:

% cat rules
location / {
    if ($scheme = 'http') {
        return 301 https://$http_host$request_uri;
    }
    proxy_set_header Host app.tsuru.company.com;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Forwarded-Host $host;
    proxy_pass http://app.tsuru.company.com:80/;
    proxy_redirect ~^http://app.tsuru.company.com(:\d+)?/(.*)$ /$2;
}
% tsuru rpaas route -i instance -p / -c "`cat rules`" add
route successfully added

The magic happens at:

    if ($scheme = 'http') {
        return 301 https://$http_host$request_uri;
    }

But as we're overriding the / location, we need to ensure that we add all the rules created automatically by rpaas (how to know them? check it out).

We need:

  • a command to force https on bound applications, so we customize the default location entry
  • a flag in the route add command to force https in custom routes

It's not a plugin-only change, it also demands changes in the API.

show a nice msg when getting status from rpaas instances

When checking for status of a brand new rpaas instance we receive an 404 HTTP error message. It could be a better message:

tsuru rpaas status -s rpaas-be-lab -i teste
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 558, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 404: Not Found

plugin: route list doens't work

When I try to list routes on my RPaaS plugin shows nothing.

$ tsuru rpaas route -s rpaas-service -i rpaas-instance list
path: destination

But on tsuru service-info it appears.

change user quota

It would be nice to be able to view/change user quota for creating rpaas instances.

nginx: drop DAV

Currently, we use DAV for managing the configuration of nginx, which means that we have one route for uploading the configuration file, and another for reloading nginx. It works, but is definitely non-elegant.

We could use something like consul-template or confd for dynamically manage the configuration. This would allow us to customize other parts of the configuration as well, and have certain changes that trigger a restart instead of a reload.

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.