Hacker News new | ask | show | jobs
by shawabawa3 3344 days ago
Looks interesting except imo the configuration makes it basically unusable.

They use jinja2 templated json... and there are hundreds of lines for their "simple" examples.

Even the "hello world" type example of proxying to google is a mess https://github.com/lyft/envoy/blob/master/configs/google_com...

5 comments

This is a battle that repeats itself ever so often. Same deal with kubernetes config files.

It's the same opinionated positions of puppet vs chef/ansible. Building the tooling in the form of an embedded programming language (lua for nginx, python for ansible) is so much better.

But that is a much more polarising position to take. It's politically untenable. Ruby engineers will say no to python and vice versa... So you start arriving at Json or XML based configurations which are a programmatic neutral ground.

IMHO lua-jit occupies the same political neutrality as XML.

I love how history repeats itself.

I remember everyone complaining about Spring and similar having these massive XML configuration files, and then people said "never again!", and moved to very simple JSON formats for their frameworks. And then everyone adds a little bit to the best practices, and over time we get this, again.

Seriously. How about we just call it EJB 4.0?
JSON Server Faces™
I tried to give it a try, and gave up for now.

1. quite hard to "give it a spin" without using docker (vomit). I eventually found some random github repo that had centos7 compatible build scripts, and it took quite a while to compile it on a test vm since it had to build gcc and a ton of other stuff. Not sure why they can't just supply a static binary "release".

2. The config really is a mess. I managed to get something almost working (only / requests went through the proxy, but nothing else for some reason, even though I was using a prefix config). There aren't really any good example configs I could find either. There is a weird config builder script with json templates in the configs dir, but it just seemed to spew out some preconfigured madness.

I am sure it works great and has more tunables than you can shake a stick at, but for now it seems to be only usable by people who have lots of time to invest in trying it out.

That's how they use it, that's not how you have to choose to use it. It is one of the most tedious aspects of the tool but all the different aspects exist for a reason, there just needs to be an easy mode for people starting off.
The example you linked isn't so bad. Perhaps a bit verbose for a simple example. The formatting of the json is ugly though, and I think they would do better to not collapse the whitespace inside arrays.
Seems like they could have used something a bit nicer to work with too (yaml, libucl, hocon, etc). I am honestly getting tired of editing fiddly json (no comments, last element in list can't have a comma, etc) all over the place.
You can use hjson for human editable json.

http://hjson.org/try.html

Human editable json, with comments, and doesn't kill you for a lack of trailing comma.

Available libraries in tons of languages.

That actually looks pretty nice. Thanks for the link!
Given Google's involvement, I am wondering why they did not choose jsonnet?
Hopefully, it was avoided on purpose because it's a complete nightmare to use.
Honest question: How so?

I have not used it in anger - just played around with it.

Too much indirection.

You get big files filled with variables, loaded from other big files also full of variables. It's hard to know what you are setting after a while or where it comes from.

After a while playing with configuration systems, I'm starting to think that configuration should just be hardcoded once and for all.