Skip to content

aneshas/gourmet

Repository files navigation

Gourmet

Gourmet

wercker status codecov Go Report Card

Gourmet is a light weight L7 proxy written in Go as a personal experiment. It offers a number of features, such as service discovery (static/dynamic), load balancing, passive health checks, TLS termination etc...

Configuration

Here is an example configuration with all the options that are configurable at this moment:

[upstreams]
    [upstreams.backend]
        balancer="round_robin" # default round_robin 
        provider="static"      # default static

        [[upstreams.backend.servers]]
            path="api1.foo.bar"
            weight=5 # optional weight

        [[upstreams.backend.servers]]
            path="api2.foo.bar"

        [[upstreams.backend.servers]]
            path="api3.foo.bar"

    [upstreams.front]
        provider="static"
        balancer="round_robin"

        [[upstreams.front.servers]]
            path="static1.foo.bar"
            weight=2    

        [[upstreams.front.servers]]
            path="static2.foo.bar"

        [[upstreams.front.servers]]
            path="static3.foo.bar"

[server]
    port=80 # default is 8080

    [[server.locations]]
        location="api/(.+/?)"
        upstream="backend"

    [[server.locations]]
        location="static/.+/?"
        upstream="front"

TODO v0.1.0

  • Recieve on req.Context().Done()
  • Passive health checks with max_fail and fail_timeout (per upstream server with defaults if not specified)
  • Add html and json error responses based on Accept header
  • Add pass regexp path match toggle
  • Move compose to main (pass it as a func to config.Parse?)
  • Add access log
  • Health fail recover
  • Implement random
  • Complete test coverage
  • Add section to readme
  • Add minimal and full config to readme (add test for minimal config)
  • Add queue size to upstream server toml config
  • Kube provider using endpoints (watch?) and test integration using minikube
  • Implement least_conn
  • Explain config sections eg. upstream static and kube provider
  • Deploy docker image with wercker
  • End to end integration test (minikube / sidecar proxy)
  • SSL configuration support (add server name to config)

v0.1.1 ideas

  • benchmarks
  • err template file override
  • Add observability support (tracing, configurable logging, prometheus stats)
  • provide lets encrypt as an option for automatic ssl?

v0.2.0 ideas

  • Use raw net and TCP instead of HTTP
  • Support for multiple servers
  • Add option to pass custom headers
  • Implement different upstream providers/backends (service discovery options) eg. consul...
  • Add more protocols
  • Providers and protocols as .so plugins?