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

[API server] use loadbalancer to expose ingress by default #4926

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

aylei
Copy link
Collaborator

@aylei aylei commented Mar 11, 2025

close #4920

Motivation of changing the defaults: LoadBalancer (if available) is more stable and secure compared to NodePort, correspondingly better UX and lower support costs.

Note: LoadBalancer might be unavailable on some k8s infra, we still make it default because it is the de-facto way to expose L4 endpoint. As an example, nginx-ingress also use LoadBalancer as default service type https://artifacthub.io/packages/helm/ingress-nginx/ingress-nginx

Tested (run the relevant ones):

  • Code formatting: install pre-commit (auto-check on commit) or bash format.sh
  • Manually Tested on GKE
  • Manually Tested on EKS
  • Manually Tested on AKS
  • All smoke tests: /smoke-test (CI) or pytest tests/test_smoke.py (local)
  • Relevant individual tests: /smoke-test -k test_name (CI) or pytest tests/test_smoke.py::test_name (local)
  • Backward compatibility: /quicktest-core (CI) or conda deactivate; bash -i tests/backward_compatibility_tests.sh (local)

@aylei aylei marked this pull request as ready for review March 11, 2025 04:49
aylei added 2 commits March 11, 2025 12:56
Signed-off-by: Aylei <[email protected]>
Signed-off-by: Aylei <[email protected]>
Copy link
Collaborator

@romilbhardwaj romilbhardwaj left a comment

Choose a reason for hiding this comment

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

Awesome, thanks @aylei!

Comment on lines +281 to +282
helm upgrade --install -n $NAMESPACE $RELEASE_NAME skypilot/skypilot-nightly --devel \
--set ingress.nodePortEnabled=false
Copy link
Collaborator

Choose a reason for hiding this comment

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

Will this also delete the old NodePort service?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, this command is solely for deleting the old NodePort service

# Use ClusterIP here to disable the LoadBalancer created by nginx.
# If not using NodePort, set this to LoadBalancer.
type: ClusterIP
type: LoadBalancer
Copy link
Collaborator

Choose a reason for hiding this comment

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

IIUC, in the future this can directly be set to NodePort for users who want to use nodeport? If so, we should probably remove the ingress.nodePortEnabled right before 0.9.0 release.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Same for charts/skypilot/templates/ingress-nodeport.yaml - that file should be removed before 0.9.0. Good to have a TODO there.

Copy link
Collaborator Author

@aylei aylei Mar 12, 2025

Choose a reason for hiding this comment

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

Yes, I think setting ingress-nginx.controller.service.* is recommended after this PR for new deployments. But it requires the similar migration steps for legacy deployments to abandon the additional node port service:

  1. Enable the nginx NodePort service, since 30050 and 30051 have been used, the new service should pick up new ports;
  2. Ask clients to migrate to the new server URL (with new ports)
  3. Set ingress.nodePortEnabled=false to delete the old NodePort service

Not sure whether we should keep the additional node port service to simplify upgrades for nightly users, but we can document the above steps and leave the choice to users. It is reasonable to take no action if they are happy with current setup.

# Specific nodePort to use for the ingress controller
# If not set, Kubernetes will assign random ports in the NodePort range (default 30000-32767)
# Deprecated: use ingress-nginx.controller.service.nodePorts.http instead
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we add a note to remove this before 0.9.0 release? Same for the nodePortEnabled field.

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.

[API server] support k8s ssh tunneling through LB
2 participants