Live data from Hacker News

HashiCorp Consul 1.2: Service Mesh

hashicorp.com

21–30 of 50 posts

Re: HashiCorp Consul 1.2: Service Mesh

#21
post #2

Could someone care to elaborate what are the main differences between Consul and Istio? What would be the primary reasons to choose one service mesh over the other?

Well, I don't know how mature the service mesh aspects of Consul will be now, but the rest of it is a very mature product that provides a distributed K/V store like etcd and also provides service discovery via either REST or DNS.

Re: HashiCorp Consul 1.2: Service Mesh

#22
post #17

If you're using Consul for web services, I really recommend the Traefik web server: https://traefik.io Traefik replaces Nginx: it's the reverse proxy that maps the incoming requests to your various services, which are advertising on some arbitrary localhost port. The amazing thing is that Traefik integrates with Consul: you only need to point it to your Consul endpoint, and it can automatically publish your services!…

We tried Traefik, but ultimately went with Fabio, which also integrates with Consul nicely; plus it does tcp based stuff for unencrypted gRPC services we shuffle around (which at the time, traefik didn't have.)

How production-ready is Fabio? It looks interesting but I can't tell how mature of a product it is

Re: HashiCorp Consul 1.2: Service Mesh

#23

If you're using Consul for web services, I really recommend the Traefik web server: https://traefik.io Traefik replaces Nginx: it's the reverse proxy that maps the incoming requests to your various services, which are advertising on some arbitrary localhost port. The amazing thing is that Traefik integrates with Consul: you only need to point it to your Consul endpoint, and it can automatically publish your services!…

Traefik isn't worth the trouble. We used it in production over the course of 2 years, and it was consistently our only source of downtime due to rediculous bugs: not closing file descriptors, breaking changes, and silent failures with no log output, panic or exit even with debug logs enabled.

As you mentioned, the docs are terrible. What makes that worse are the undocumented breaking changes between each release. They don't even pretend to follow semver, so v1.5 broke v1.4, and v1.6 broke v1.5. Each update you pray that it doesn't take your whole setup down. If anything goes wrong, since nothing is documented and there's often no logs explaining what went wrong, you might be down for an extended period while you make 100 best-guess changes to the config that worked in staging, but for whatever reason isn't working in production. May the odds be ever in your favor.

Last I checked, Traefik was 988,000 (!!!) lines of code. That's 20x the size of my very complex web application. I replaced it with 500 lines of go providing all the essential features for me. Higher reliability, way fewer bugs, no breaking changes.

Re: HashiCorp Consul 1.2: Service Mesh

#24

If you're using Consul for web services, I really recommend the Traefik web server: https://traefik.io Traefik replaces Nginx: it's the reverse proxy that maps the incoming requests to your various services, which are advertising on some arbitrary localhost port. The amazing thing is that Traefik integrates with Consul: you only need to point it to your Consul endpoint, and it can automatically publish your services!…

In the free version, you have to rewrite the config and restart the service. That's not fun if you expect services to come and go as part of your natural life-cycle If that's happening super-frequently I could see the problem, but in practice I'd expect you to use `consul-template` and issue a `reload` to nginx to make it reload configurations with no downtime. This is the solution I've used and it works pretty well.

You can also use the consul k-v store as your source of traefik config and then update the config in consul and it updates in traefik instantly without any restart.

Re: HashiCorp Consul 1.2: Service Mesh

#25
post #8

If you want to try the new Connect feature from Consul yourself, we've put up an interactive tutorial on our Instruqt learning platform, together with the nice folks at HashiCorp: https://play.instruqt.com/hashicorp/tracks/connect

this instruqt thingy is pretty cool, it's actually addictive. I started with the Connect course and I'm not going for Istio:

> Please wait while we setup a Kubernetes cluster with Istio preinstalled. In the meantime, browse through these notes to learn more about the sample application.

damn

Re: HashiCorp Consul 1.2: Service Mesh

#26

If you're using Consul for web services, I really recommend the Traefik web server: https://traefik.io Traefik replaces Nginx: it's the reverse proxy that maps the incoming requests to your various services, which are advertising on some arbitrary localhost port. The amazing thing is that Traefik integrates with Consul: you only need to point it to your Consul endpoint, and it can automatically publish your services!…

With nginx, you can do dynamic binding in the free version in at least two ways:

1. If you "just" want to map a hostname, to a private IP, you can assign the hostname to a variable, and use the variable in your backend config. This works because Nginx resolves static addresses at start, but resolves names pulled from variables at runtime.

2. If you need to map ports as well, you can use a Lua or Mruby script. E.g. I have a blog post on doing it with mruby here [1], and it's run production sites for a couple of years. This options lets you integrate against pretty much whatever you want.

It's extra hassle, though, of course.

[1] http://hokstadconsulting.com/nginx/mruby-virtualhosts

Re: HashiCorp Consul 1.2: Service Mesh

#27
post #17

Earlier quoted context omitted.

We tried Traefik, but ultimately went with Fabio, which also integrates with Consul nicely; plus it does tcp based stuff for unencrypted gRPC services we shuffle around (which at the time, traefik didn't have.)

How production-ready is Fabio? It looks interesting but I can't tell how mature of a product it is

It's okay for our use case. Honestly, we were just wanting to get a load balancer up and working with consul, and we had grpc services and internal http apps to balance.

I'm not going to lie; it works and does failover correctly, quickly, and plays nice with consul. Not to mention, the name brings back memories...

If I had my way though, we would use HAProxy, but that's just because there is more options, ways to properly route, and more battle-tested.

Re: HashiCorp Consul 1.2: Service Mesh

#28
post #11
post #9

Earlier quoted context omitted.

Old workers stay around until all the connections for them or their grace period has expired. So i hope you're not too close to the resource limit to handle many generations of workers sticking around. also if you have many services behind a single port with path based routing and do a deploy the connection will stick around on the old workers until everything dies. It's super fun with haproxy :(

Kind of bad, but what's the alternative? Cut everyone off on reload?

kong. uses lua. has a wonderful API.

Re: HashiCorp Consul 1.2: Service Mesh

#29
post #11

Earlier quoted context omitted.

Kind of bad, but what's the alternative? Cut everyone off on reload?

Have a better proxy that doesn't need to create a new generation of workers for config changes. Like traefik or envoy or nginx when you pay for it or use the lua shit to do backend discovery (haproxy also has lua shit iirc)

Could you elaborate on what's wrong with using lua with ningx, especially as used by kong?

Re: HashiCorp Consul 1.2: Service Mesh

#30
post #23

If you're using Consul for web services, I really recommend the Traefik web server: https://traefik.io Traefik replaces Nginx: it's the reverse proxy that maps the incoming requests to your various services, which are advertising on some arbitrary localhost port. The amazing thing is that Traefik integrates with Consul: you only need to point it to your Consul endpoint, and it can automatically publish your services!…

Traefik isn't worth the trouble. We used it in production over the course of 2 years, and it was consistently our only source of downtime due to rediculous bugs: not closing file descriptors, breaking changes, and silent failures with no log output, panic or exit even with debug logs enabled. As you mentioned, the docs are terrible. What makes that worse are the undocumented breaking changes between each release. The…

Re LOC: Found the 988k LOC number hard to believe, so I checked. If you count the vendored dependencies, then it's indeed a lot, about 1M LOC. Traefik itself though is comparatively a lot less at about 60k lines of Go code with another 8k or so of scripts, config etc.
Post reply on HN