3 ms·
Ugh why, why does every unix tool slowly grow until it includes an HTTP server, GRPC, etc. UCSPI would ideal here.
by nwmcsween 7y ago
Ugh why, why does every unix tool slowly grow until it includes an HTTP server, GRPC, etc. UCSPI would ideal here.
- user5994461 7y agoIt's an HTTP load balancer. It supported HTTP from the start.
- spenczar5 7y agoIn what sense is HAProxy a "unix tool?"
- deleted 7y ago[deleted]
- jrockway 7y agoI do not understand your complaint. It's a layer 7 HTTP load balancer, so it has to understand HTTP. As for why people use APIs for configuring things, it's because infrastructure changes frequently enough that encoding it in a static file isn't practical. Imagine you are rolling out a new software release. There are 100 replicas. You could start up a new replica, see if it passes health checks, edit the haproxy config to configure that as an endpoint, wait for haproxy to start sending it traffic, check that it's working, edit the config file again to remove the old version's replica, wait for haproxy to acknowledge that change, shut down the old replica... and finally do that again 99 more times. Nobody wants to do that, so there's an API to inform your frontend load balancer of where your workers are. When it needs some endpoints, you tell it. I guess an even better example is TLS certificates. They expire every 3 months. What do you do when a new one is released? Drain traffic from one load balancer, copy the certificate and key over, wait for the load balancer to restart, and then undrain traffic? No, that's a huge pain. You just have your load balancer connect to your secret discovery service and have the same program the renews the certificate send your load balancers the new certificate. Then you don't have to drain; when a new connection comes in, you present the new certificate. All these config APIs make it possible to operate software at scale. You probably don't need it for your personal website. But you could probably eschew servers entirely and just nc -l on port 80 and type the response in your terminal when a request comes in and still have a mostly-working website.
- nwmcsween 7y agoThe issue isnt that it has to understand HTTP, the issue is HTTP is now a baked in configuration method that must be supported forever. Using UCSPI one could just spit out text, template with awk, chain to tcp server and to whatever your heart desires.
- zaarn 7y agoOn the other hand, you can trivially handle the API with jq and curl, both very simple unix tools that do what awk can do just better since the data is structured.
- rickycook 7y agowell you’ll be pleased to know that the data plane API is a sidecar. you don’t have to run it if you don’t want to :)