#66561·ray

[Core] image_uri / container runtime env workers can't get the token under Kubernetes token auth

Author: MortalHappinessCreated Sep 29, 2026Updated Sep 29, 2026
Labelsgood-first-issuekuberaycore

Description

With Kubernetes token auth (RAY_ENABLE_K8S_TOKEN_AUTH=true, which KubeRay sets for K8s auth mode), workers started through the image_uri or container runtime env probably can't authenticate.

KubeRay mounts a projected service account token at /var/run/secrets/ray.io/serviceaccount/token in the Ray container, and the token loader reads it from there. The runtime env plugin in python/ray/_private/runtime_env/image_uri.py forwards RAY_AUTH_MODE and RAY_ENABLE_K8S_TOKEN_AUTH into the podman worker container, but only mounts the Ray temp dir, so the worker has no token.

There may be other files need to be mounted, so contributor should mount those files too.

This comes from reading the code and hasn't been reproduced. Contributors should verify it on a KubeRay cluster with K8s token auth enabled first, then decide on a fix, for example mounting the token directory into the container. The kubelet rotates projected tokens, so a fix should keep working after rotation.

Related: #66467 mounts the regular token file (~/.ray/auth_token or RAY_AUTH_TOKEN_PATH) into these containers but doesn't cover the K8s token.