Skip to content

Conversation

aylei
Copy link
Collaborator

@aylei aylei commented May 24, 2025

close #5725

Two issues are addressed:

  1. Add env var override to /validate handler;
  2. Fix KUBECONFIG reload issue of kubernetes lib;

Tested (run the relevant ones):

  • Code formatting: install pre-commit (auto-check on commit) or bash format.sh
  • Manually tested changing KUBECONFIG locally:
(sky) ➜  skypilot git:(master) ✗ export KUBECONFIG=~/.kube/config
(sky) ➜  skypilot git:(master) ✗ sky launch --cpus 2 "echo hello" --cloud kubernetes --region gke_sky-dev-465_us-central1-c_skypilotalpha -c aylei2
The --cloud, --region, and --zone options are deprecated. Use --infra instead.
Command to run: echo hello
ValueError: Context gke_sky-dev-465_us-central1-c_skypilotalpha not found in kubeconfig. Kubernetes only supports context names as regions. Available contexts: ['kind-kind']
(sky) ➜  skypilot git:(master) ✗ export KUBECONFIG=~/.kube/gke
(sky) ➜  skypilot git:(master) ✗ sky launch --cpus 2 "echo hello" --cloud kubernetes --region gke_sky-dev-465_us-central1-c_skypilotalpha -c aylei2
The --cloud, --region, and --zone options are deprecated. Use --infra instead.
Command to run: echo hello
Considered resources (1 node):
--------------------------------------------------------------------------------------------------
 INFRA                                    INSTANCE   vCPUs   Mem(GB)   GPUS   COST ($)   CHOSEN
--------------------------------------------------------------------------------------------------
 Kubernetes (gke_sky-dev...ypilotalpha)   -          2       2         -      0.00          ✔
--------------------------------------------------------------------------------------------------
Launching a new cluster 'aylei2'. Proceed? [Y/n]: ^CAborted!
  • 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 pytest tests/smoke_tests/test_backward_compat.py (local)

Sorry, something went wrong.

aylei added 2 commits May 24, 2025 22:14
Signed-off-by: Aylei <rayingecho@gmail.com>
Lint
Signed-off-by: Aylei <rayingecho@gmail.com>
@aylei aylei requested review from cg505 and Michaelvll May 24, 2025 14:22
@concretevitamin
Copy link
Member

Nice @aylei, is it easy to add a regression test?

@aylei aylei marked this pull request as ready for review May 25, 2025 00:03
@aylei
Copy link
Collaborator Author

aylei commented May 25, 2025

Nice @aylei, is it easy to add a regression test?

Sure, thanks for the reminder!

Signed-off-by: Aylei <rayingecho@gmail.com>
Copy link
Collaborator

@cg505 cg505 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 the fix!

@aylei aylei merged commit 2521322 into master May 28, 2025
22 checks passed
@aylei aylei deleted the fix-kubeconfig-override branch May 28, 2025 04:40
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] Failed to reload KUBECONFIG env var for local API server
3 participants