Skip to content
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

[K8s] Use external-ip if configured on nginx ingress #3200

Merged
merged 3 commits into from
Feb 21, 2024

Conversation

romilbhardwaj
Copy link
Collaborator

On some on-prem clusters, ingresses may be exposed through a NodePort service that is backed by a custom external-ip set by the cluster admin. We should return this ip when queries through sky status --endpoints instead of returning localhost.

This PR adds support for reading external-ip if it is set. Also updates docs for clarity on how to use nginx ingress.

# Before:
$ sky status --endpoints test
8888: http://localhost:30008/skypilot/test-2ea4/8888

# After:
# If external-ip is configured and backed by nodeport svc
$ sky status --endpoints test
8888: http://192.156.211.1:30008/skypilot/test-2ea4/8888 

# If external-ip is not configured and backed by nodeport svc
$ sky status --endpoints test
8888: http://localhost:30008/skypilot/test-2ea4/8888 

This is also helpful for skyserve on nginx ingress, since localhost is not accessible from the skyserve controller.

Cherry-picking this change from #3109 for v0.5 release.

Tested (run the relevant ones):

  • Code formatting: bash format.sh
  • Manual tests - sky launch a ports yaml on a) k3s cluster with this custom nodeport based ingress setup b) GKE cluster with regular loadbalancer based ingress.

@romilbhardwaj romilbhardwaj added this to the v0.5 milestone Feb 20, 2024
Copy link
Collaborator

@Michaelvll Michaelvll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this @romilbhardwaj! LGTM.

@romilbhardwaj romilbhardwaj merged commit e51c2fb into master Feb 21, 2024
19 checks passed
@romilbhardwaj romilbhardwaj deleted the k8s_ingress_extip branch February 21, 2024 01:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants