add: rewriter logic and tests

This commit is contained in:
2025-03-29 22:44:06 -07:00
parent 116596a9e6
commit 5f44cb2f4e
10 changed files with 773 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
# A simple Kubernetes load balancer
Configures nginx to forward connections to your node IPs.
Services should be declared as NodePort, which means that they
open a port on all nodes. When the request lands on any node,
it is forwarded to the correct pod via the network mesh kubernetes
is using. In theory, there is one a hop penalty.
But lets be honest. You're running with a single LB, probably a GCE free
tier N1 VM. That extra hop doesn't matter.
## Config
Configure nginx to do what you want, test it. Use any Node IP for your testing.
This tool accepts an argument (rewrite_string) which will be replaced using these rules:
1. For each line that contains rewrite string:
2. Copy the line once per node IP, replacing the string with host IPs