Skip to content

feat(k8s): Update OpenShell server to accept kubeconfig, support out-of-cluster access #1017

Closed as not planned

Description

@TaylorMutch

The current implementation on the OpenShell server's kubernetes driver assumes in-cluster access only. Adding support for out-of-cluster access would enable development loops of the Gateway when scheduling sandboxes on Kubernetes.

Activity

  1. TaylorMutch commented on Apr 28, 2026

    @TaylorMutch
    CollaboratorAuthor

    Research finding: already implemented

    This feature is already present in the codebase. The Kubernetes driver initializes its client as follows (crates/openshell-driver-kubernetes/src/driver.rs:121–126):

    let base_config = match kube::Config::incluster() {
        Ok(c) => c,
        Err(_) => kube::Config::infer()
            .await
            .map_err(kube::Error::InferConfig)?,
    };

    kube::Config::incluster() succeeds when running inside a Kubernetes pod (service account mounted). When it fails — including when the Gateway runs locally — kube::Config::infer() is called, which reads the standard KUBECONFIG environment variable and falls back to ~/.kube/config. This is the idiomatic out-of-cluster pattern for Kubernetes clients in Rust.

    No code changes are needed. The local development workflow using KUBECONFIG pointing at a k3d cluster is described in #1016.

    Closing as already resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions