Skip to content

Conversation

@m-k8s
Copy link

@m-k8s m-k8s commented Nov 16, 2025

Summary

Add support for configuring Kubernetes context via K8S_CONTEXT setting, similar to the existing K8S_NAMESPACE configuration.

Changes

  • Add K8S_CONTEXT configuration option in defaults (empty by default)
  • Update all kubectl commands to use --context flag when configured
  • Update Kubernetes Python API client to load the specified context
  • Add kubectl_base_args() helper function following the DRY principle

Behavior

  • When K8S_CONTEXT is empty (default): uses the current context from kubeconfig
  • When K8S_CONTEXT is set: all kubectl commands and API calls use the specified context

Testing

Tested with a fake context set as default in kubeconfig to ensure Tutor uses the configured K8S_CONTEXT instead of the kubeconfig's current-context.

Allow users to configure the Kubernetes context via K8S_CONTEXT
setting, similar to K8S_NAMESPACE. When set, all kubectl commands
and Kubernetes API calls use the specified context.
@m-k8s
Copy link
Author

m-k8s commented Nov 16, 2025

Waiting for approval to run the "Run tests" workflow before marking this PR as ready for review.

@m-k8s m-k8s marked this pull request as ready for review November 18, 2025 18:08
@ahmed-arb ahmed-arb requested a review from mlabeeb03 November 25, 2025 09:06
@ahmed-arb ahmed-arb moved this from Pending Triage to In review in Tutor project management Nov 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

1 participant