-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
roachprod: load balancer postgres URL #121831
roachprod: load balancer postgres URL #121831
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
pkg/roachprod/install/services.go
Outdated
return &a, nil | ||
} | ||
} | ||
return nil, nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: should we just return a "load balancer not found" error here so that way callers of this function don't need to manually check if address is nil?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point! done.
pkg/roachprod/install/expander.go
Outdated
e.pgHosts, err = c.pghosts(ctx, l, allNodes(len(c.VMs))) | ||
switch m[1] { | ||
case ":L": | ||
addresses, err := c.ListLoadBalancers(l) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hrmm, don't the semantics of pghost
get a bit murky with this implementation of pghost
?
Say I create a load balancer for system and tenant in the cluster. What does it mean to say {pghost:L}
in that case? Not sure if the List*
functions are deterministic (w.r.t. ordering of LBs), in which case it could get even more confusing.
Maybe the "two load balancer" scenario is not common enough. It probably wouldn't hurt if pghost
took a virtual cluster name parameter as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, this won't work well for multiple load balancers. Adding a tenant group to this.
if err != nil || address == nil { | ||
return "", err | ||
} | ||
loadBalancerURL := c.NodeURL(address.IP, address.Port, virtualClusterName, serviceMode, AuthRootCert) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we take auth
as parameter? I know it will complicate matters for the expanders, but assuming root doesn't seem right either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch, yes we should pass auth
. Done. Also updated to use the same auth as the other expanders.
baf4be0
to
b2bd159
Compare
Add the ability to find a load balancer given the service port it serves. If no port (0) is specified the first load balancer found will be returned. Epic: None Release Note: None
Add ability to get the postgres URL for a load balancer given a service. Epic: None Release Note: None
Add "L" to the node expansion in `roachprod` (e.g., `test-cluster:L` vs. `test-cluster:1`). This allows users to pass "L" instead of a node range / number. It will return the load balancer IP or postgres URL (depending on the expander used) and will enable `workload` and other utilities to target the load balancer IP rather than a specific node. Epic: None Release Note: None
Epic: None Release Note: None
b2bd159
to
8cb12bd
Compare
TFTR! bors r=DarrylWong |
Add "L" to the node expansion in
roachprod
(e.g.,test-cluster:L
vs.test-cluster:1
). This allows users to pass "L" instead of a node range /number. It will return the load balancer IP or postgres URL (depending on the
expander used) and will enable
workload
and other utilities to target the loadbalancer IP rather than a specific node.
Epic: None
Release Note: None