Repository navigation
Not planned
Labels
bugCategorizes issue or PR as related to a bug.help wantedExtra attention is neededneeds-priorityIndicates a PR lacks a label and requires one.needs-triageIndicates an issue or PR lacks a label and requires one.
Description
What happened:
createOrUpdatePod skips PopulateEnvironmentVariables, so CreatePod receives the Pod with secretKeyRef, configMapKeyRef and envFrom intact.
To solve it:
The option
From v1.13.0, virtual-kubelet's PodControllerConfig has SkipDownwardAPIResolution:
// SkipDownwardAPIResolution can be used to skip any attempts at resolving downward API references
// in pods before calling CreatePod on the provider.
// Providers need this if they need to do their own custom resolving
SkipDownwardAPIResolution bool
When it's set, createOrUpdatePod skips PopulateEnvironmentVariables, so CreatePod receives the Pod with secretKeyRef, configMapKeyRef and envFrom intact. Nebula would set it in pkg/vnode/node.go. Then:
- The Kubernetes provider keeps the references (bringing remoteEnv back). No Secret value is written into a Pod spec, and the target's kubelet reads the reflected copies. That closes the review comment properly.
- resolveEnv becomes the real resolver for Modal and AWS, with the rules it already documents. The Config/Secrets split becomes real, and the empty Service lister trick for service links is no longer needed.
What it costs
- A dependency upgrade. Nebula is on virtual-kubelet v1.11.0, client-go v0.33.4 and controller-runtime v0.21.0. Virtual-kubelet v1.13.0 requires client-go v0.35.4 and controller-runtime v0.23.3, and v1.14.1 requires v0.37.1 and v0.25.2. That's a repo-wide bump, which belongs in its own PR.
- Behaviour changes for Modal and AWS, since resolveEnv's rules would apply instead of virtual-kubelet's:
- $(VAR) in env values would no longer be expanded.
- status.* field references, such as status.podIP, would be refused with a ConfigError.
- A missing required reference would fail in Nebula's CreatePod instead of in virtual-kubelet.
What you expected to happen:
How to reproduce it (as minimally and precisely as possible):
Anything else we need to know?:
Environment:
Metadata
Metadata
Assignees
Labels
bugCategorizes issue or PR as related to a bug.help wantedExtra attention is neededneeds-priorityIndicates a PR lacks a label and requires one.needs-triageIndicates an issue or PR lacks a label and requires one.
Activity
kerthcet commentedon Nov 26, 2026
/help
chore(deps): bump virtual-kubelet to v1.13.0 (#164)
kerthcet commentedon Nov 28, 2026
Closing as won't fix for now. #165 implemented this (skip virtual-kubelet's resolution for the Kubernetes provider only, pass env/envFrom through to the target kubelet), but it regresses metadata
fieldRefs: they resolve against the real pod, not the placeholder, and the real pod differs by design:metadata.annotations['…']→""(only Nebula's annotations are set). This breaks Indexed Jobs:JOB_COMPLETION_INDEXis empty.metadata.labels['k']→""for keys outside--kubernetes-propagate-labels/--cost-labels.metadata.name→ the claim name (<namespace>-<pod>),metadata.uid→ the real pod's,spec.serviceAccountName→"".Fixing it would mean inlining those metadata references from the placeholder in
buildPod, on top of the pass-through. We keep virtual-kubelet's resolution instead: every reference resolves against the placeholder, and the trade-off, Secret values inline in the target pod spec, is accepted while target clusters are Nebula-only. Resolving in the target also let a host workload read a target-owned Secret of a matching name; that goes away too.virtual-kubelet v1.13 (#164) stays, so
SkipDownwardAPIResolutionand #165's approach are available if this is revisited.