Giter Site home page Giter Site logo

emissary-ingress / emissary Goto Github PK

View Code? Open in Web Editor NEW
4.3K 87.0 681.0 117.17 MB

open source Kubernetes-native API gateway for microservices built on the Envoy Proxy

Home Page: https://www.getambassador.io

License: Apache License 2.0

Python 52.27% Shell 2.40% Makefile 3.49% HTML 0.73% Dockerfile 0.48% Go 40.45% Mustache 0.10% Awk 0.08%
ambassador kubernetes gateway-api microservice cloud-native api-gateway docker api-management kubernetes-ingress envoy-proxy

emissary's People

Contributors

acookin avatar aliceproxy avatar anodelman avatar aosoriodw avatar ark3 avatar brucehorn avatar cindymullins-dw avatar concaf avatar danielbryantuk avatar dansipple avatar ddymko avatar dependabot[bot] avatar douglascamata avatar esmet avatar impl avatar inercia avatar inoahnothing avatar kelseyevans avatar kflynn avatar khussey avatar lavoiedn avatar lukeshu avatar mattmcclure-dw avatar plombardi89 avatar richarddli avatar rick-a-lane-ii avatar scoyle391 avatar tenshinhigashi avatar thallgren avatar ysaakpr 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  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

emissary's Issues

Users need a way to recover from configuration errors

We had a fun situation here where a tester made a bad change to Ambassador's config (specifically, they fed Ambassador an extauth URL that was malformed) and its Envoy crashed. In this case, you can't recover without some serious magic.

Thus:

  • move Ambassador's admin port out from behind Envoy
  • let Ambassador keep running even if Envoy crashes
  • have a way to force Ambassador to kill & restart the Envoy, and/or to force Ambassador to exit so that Kubernetes restarts the pod

Prototype: Ambassador Authentication Filter

First stage of GH-9

  • Prototype code to validate the external authentication mechanism and learn how to implement properly as well as learn Envoy toolchain.
  • Prototype Documentation
  • Plan for moving from Prototype to GA.

External Authentication Service Documentation

We have a prototype authentication service, but we have no documentation for how to use it.

DoD:

  • Document how to configure Ambassador to use the auth service
  • Document how to use the reference auth service
  • Document the REST API between the auth filter and the auth service, so that custom implementations can be written if desired.

mysteriously wedged sds

My ambassador got into a mysteriously wedged state. It was responding just fine to /ambassador/* queries, but it refused to route to my upstream "hello" cluster.

After some head scratching I managed to track this down to the sds service being wedged. I was able to diagnose this because a) the sds service was hanging when I queried it, and b) I got the appended stack trace from the logs.

This raises the obvious question of why it got wedged in this way, but perhaps more importantly this points to the need for some kind of health checking on the various envoy "plugin" services.

[rhs@venture hello]$ kubectl logs ambassador-sds-3085809130-cp47x  
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 763, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/usr/local/lib/python2.7/dist-packages/werkzeug/serving.py", line 699, in inner
    srv.serve_forever()
  File "/usr/local/lib/python2.7/dist-packages/werkzeug/serving.py", line 536, in serve_forever
    HTTPServer.serve_forever(self)
  File "/usr/lib/python2.7/SocketServer.py", line 238, in serve_forever
    self._handle_request_noblock()
  File "/usr/lib/python2.7/SocketServer.py", line 297, in _handle_request_noblock
    self.handle_error(request, client_address)
  File "/usr/lib/python2.7/SocketServer.py", line 295, in _handle_request_noblock
    self.process_request(request, client_address)
  File "/usr/lib/python2.7/SocketServer.py", line 321, in process_request
    self.finish_request(request, client_address)
  File "/usr/lib/python2.7/SocketServer.py", line 334, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/usr/lib/python2.7/SocketServer.py", line 649, in __init__
    self.handle()
  File "/usr/local/lib/python2.7/dist-packages/werkzeug/serving.py", line 232, in handle
    rv = BaseHTTPRequestHandler.handle(self)
  File "/usr/lib/python2.7/BaseHTTPServer.py", line 340, in handle
    self.handle_one_request()
  File "/usr/local/lib/python2.7/dist-packages/werkzeug/serving.py", line 267, in handle_one_request
    return self.run_wsgi()
  File "/usr/local/lib/python2.7/dist-packages/werkzeug/serving.py", line 209, in run_wsgi
    execute(self.server.app)
  File "/usr/local/lib/python2.7/dist-packages/werkzeug/serving.py", line 200, in execute
    write(data)
  File "/usr/local/lib/python2.7/dist-packages/werkzeug/serving.py", line 168, in write
    self.send_header(key, value)
  File "/usr/lib/python2.7/BaseHTTPServer.py", line 401, in send_header
    self.wfile.write("%s: %s\r\n" % (keyword, value))
IOError: [Errno 32] Broken pipe

Users need correct handling of service ports

Creating a service in Ambassador shouldn't need a port, because the K8s service record has the port. That requires Ambassador-SDS to honor that port number though (currently, it doesn't).

Make Ambassador installable with Helm

In order to to make Ambassador easier to distribute, install and reuse packaging at a Helm Chart is important.

Output of this Issue should be:

  • Helm chart to install Ambassador.
  • Documentation on how to use the Helm chart for installation and upgrades.

Users need URL rewriting

Envoy supports the prefix_rewrite directive to morph one URL prefix into another. We need to support that.

(We need to support many other directives, too, but this is probably first.)

Python API to operate Ambassador programatically

Desired features

  • Get Ambassador URL
  • Add certificate for Ambassador to k8s secrets
  • Add CA certificate for client auth to k8s secrets
  • Map and unmap resources
  • Retrieve existing mappings
  • Retrieve Ambassador internal stats

This will be useful for setting up release tests and soak tests, as well as providing the foundation for the actl command.

Datawire should be running a continuous soak of an Ambassador

Ambassador is meant to have a role that is operationally critical, so we should have one running all the time actually handling significant amounts of traffic while both its services and itself are coming, going, being upgraded, etc.

This would also be a good place to test various types of failures.

Operational Documentation: Installation and Upgrades

Ambassador needs documentation around Installation and Upgrade that is written from an Operational / Administrative perspective for production usage.

  • How to install Ambassador
  • How to update Ambassador (Ambassador container, Envoy, PostgreSQL)

traceback from clean install on an empty minikube cluster

I've included the logs below. The deployment goes into the CrashLoopBackoff and never seems to come alive... I see this in the logs...

[rhs@venture ambassador]$ kubectl logs ambassador-381468975-trd2g ambassador 
/application
[2017-05-04 01:20:23.017][9][warning][main] initializing epoch 0 (hot restart version=7.2490552)
[2017-05-04 01:20:23.030][9][warning][main] all clusters initialized. initializing init manager
[2017-05-04 01:20:23.034][9][warning][main] all dependencies initialized. starting workers
[2017-05-04 01:20:23.034][9][warning][main] starting main dispatch loop
2017-05-04 01:20:23 ambassador 0.8.0 INFO: initializing on ambassador-381468975-trd2g (resolved 172.17.0.5)
2017-05-04 01:20:43 ambassador 0.8.0 INFO: ambassador found restarter PID 6
Traceback (most recent call last):
  File "/application/ambassador.py", line 489, in <module>
    main()
  File "/application/ambassador.py", line 475, in main
    new_config(envoy_restarter_pid = -1)    # Don't automagically signal here.
  File "/application/ambassador.py", line 303, in new_config
    num_mappings = len(rc.mappings)
TypeError: object of type 'NoneType' has no len()

fancier way to get the external IP

No clue how cross brittle or crossplatform the tail/awk stuff is, but at least limiting to just the ambassador service would kill some noise, especially on a busy cluster.

export AMBASSADORIP=$(kubectl get services ambassador | tail -1 | awk '{print $3}')

Users need SSL support

At minimum, they need to be able to specify a cert for the listener, and whether to use SSL to the back end.

Ambassador needs a cleaner build process

The current build process relies on hand-set environment variables, making sure you manually run bump2version, doesn't really support dev builds, etc. Yuck.

A dev build - which should be any build not run under CI - needs to figure out its own version number based on the most recent tag.

CI builds should increment the version number automagically.

Dev builds should default to using the datawire-dev DockerHub org, but that must be overridable.

Users want access to Istio's more complex routing logic

Istio is capable of a rich set of routing behaviors that Ambassador should provide access to, for example:

  • A/B testing ("Split evenly between these backends")
  • Canary deployment ("1% of traffic goes to this new backend -- OK, now 2%. Now 10%...")
  • Service A goes to a cluster of 10 hosts. Service B goes to a cluster of 15. However, 5 of the hosts for B are the same as for A...

Much of these can be managed by weighted round-robin, but some will require intelligence in how Ambassador constructs Envoy clusters.

Istio Feature Check

Check that Istio features work as expected with Amabassdor. The big ticket item are that session identifiers propagate all the way to the edge and HTTP/2 works correctly.

External Authentication supports Json Web Tokens (JWT)

Ambassador needs to support Json Web Token ("JWT") an an authentication mechanism.

Information we need to collect:

  • Which algorithms?
  • Does it need to handle authorization as well as authentication (e.g. checking that the requested resource can be accessed with the claims attached to the JWT)

Outputs:

  • There is an External Authentication Service implementation with JWT
  • There is documentation for installing and configuring the JWT External Authentication Service.

Write proposal for Ambassador to Manage Istio Ingress

Currently Ambassador maintains a second Ingress rather than just managing the Istio Ingress. It would be ideal to remove this extra hop in each request routing by letting Ambassador manage the Istio Ingress directly. It would also simplify the deployment of Ambassador so that there are not two Ingresses to think about.

Outputs:

  • Draft proposal is written

Ambassador SDS breaks on unnamed ports

If you create a service where a ports entry has no name, kaboom.

ambassador-sds uses the port name to match against the service name, in case a service advertises multiple ports that aren't really the same functionality. Should be OK to assume that a nameless port is a match.

Ambassador needs to support an authentication service

As it stands, anyone in the world can do anything. That's obviously unacceptable.

The most straightforward way to handle this is to take request headers and hand them off to an auth service (which, naturally, will be vectored through Ambassador).

DoD:

  • There exists an Envoy auth filter can call a REST service to get a go/no-go decision (GH #59)
  • Datawire CI publishes a Docker image with an Envoy that includes the auth filter
  • There exists a reference auth service that the auth filter can talk to
  • Datawire CI publishes a Docker image with the auth service
  • Ambassador can be configured via REST call to use the auth filter, talking to a named auth service
  • Ambassador knows how to configure Envoy according to the configuration call above
  • Ambassador configuration is documented (#67)
  • REST API is documented (#67)

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.