-
Notifications
You must be signed in to change notification settings - Fork 295
Expose EPP and WHOIS endpoints on reginal load balancers #2627
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
Conversation
08477dc to
a25eb9c
Compare
ptkach
left a comment
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.
Reviewable status: 0 of 4 files reviewed, 1 unresolved discussion (waiting on @jianglai)
jetty/get-endpoints.py line 55 at r1 (raw file):
res = [] lines = run_command(f'kubectl get {resource}/{service}') for line in lines.split('\n'):
Just a suggestion I found a hard way myself. Instead of parsing the output as a lines, which is ok, but not great. You can pretty much always use --format=json instead . This allows for safer and cleaner approach.
Code quote:
for line in lines.split('\n'):6d5c936 to
30137b5
Compare
jianglai
left a comment
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.
Reviewed 3 of 4 files at r1, 1 of 1 files at r2, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @ptkach)
jetty/get-endpoints.py line 55 at r1 (raw file):
Previously, ptkach (Pavlo Tkach) wrote…
Just a suggestion I found a hard way myself. Instead of parsing the output as a lines, which is ok, but not great. You can pretty much always use
--format=jsoninstead . This allows for safer and cleaner approach.
Agreed.
30137b5 to
1f69e9f
Compare
1f69e9f to
7adcdec
Compare
jianglai
left a comment
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.
Reviewed 1 of 1 files at r3, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @github-advanced-security[bot] and @ptkach)
7bea165 to
7f5b913
Compare
ptkach
left a comment
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.
Reviewable status: 3 of 5 files reviewed, 2 unresolved discussions (waiting on @github-advanced-security[bot] and @jianglai)
jetty/get-endpoints.py line 137 at r4 (raw file):
for service in ['whois', 'whois-canary', 'epp', 'epp-canary']: map_key = service.replace('-', '_') for ip in get_endpoints('services', service,
It looks like it can be simplified. kubectl accepts jsonpath param, which I think would make it easier by doing something like this jsonpath='{.status.loadBalancer.ingress[0}.ip}' . I've not checked it though, I just realized I'd be really surprised if they didn't and stumbled upon this doc https://kubernetes.io/docs/reference/kubectl/jsonpath/
7f5b913 to
522b96f
Compare
jianglai
left a comment
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.
Reviewed 1 of 2 files at r4, 1 of 1 files at r5, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @github-advanced-security[bot] and @ptkach)
jetty/get-endpoints.py line 137 at r4 (raw file):
Previously, ptkach (Pavlo Tkach) wrote…
It looks like it can be simplified. kubectl accepts
jsonpathparam, which I think would make it easier by doing something like thisjsonpath='{.status.loadBalancer.ingress[0}.ip}'. I've not checked it though, I just realized I'd be really surprised if they didn't and stumbled upon this doc https://kubernetes.io/docs/reference/kubectl/jsonpath/
It does look much nicer!
ptkach
left a comment
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.
Reviewed 3 of 4 files at r1, 1 of 2 files at r4, 1 of 1 files at r5, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @github-advanced-security[bot])
k8s does not have a way to expose a global load balancer with TCP endpoints, and setting up node port-based routing is a chore, even with Terraform (which is what we did with the standalone proxy). We will use Cloud DNS's geolocation routing policy to ensure that clients connect to the endpoint closest to them.
522b96f to
56b9018
Compare
jianglai
left a comment
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.
Reviewed 1 of 1 files at r6, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @github-advanced-security[bot] and @ptkach)
k8s does not have a way to expose a global load balancer with TCP
endpoints, and setting up node port-based routing is a chore, even with
Terraform (which is what we did with the standalone proxy).
We will use Cloud DNS's geolocation routing policy to ensure that
clients connect to the endpoint closest to them.
This change is