[Bug]: Driver upgrade does not evict pods that use nvidia.com/gpu only in a native sidecar

已关闭 适合新手
#3,026 0 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

维护者通常 1 天内回复

@JunAr7112 已经在做这个了。

开始于 2026年10月12日。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
78/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
go, kubernetes

调研方向

从 cmd/gpu-operator/main.go 中的 gpuPodSpecFilter 开始。issue 指出,该函数只遍历 pod.Spec.Containers。检查它如何识别 GPU 资源请求,以及是否涵盖 pod.Spec.InitContainers 中的原生 sidecar。完成标准是:在驱动程序升级期间,一个仅在原生 sidecar 中声明 nvidia.com/gpu 的 pod 会被选中删除;issue 未指定测试文件。

由索引模型根据 Issue 内容生成。

描述

bug needs-triage

Describe the bug
During an automatic driver upgrade, the upgrade controller does not delete workload pods whose nvidia.com/gpu resource is declared only in a native sidecar container (an entry in spec.initContainers with restartPolicy: Always).
The GPU pod filter, gpuPodSpecFilter in cmd/gpu-operator/main.go, only iterates pod.Spec.Containers, so such pods are treated as non-GPU pods ("No pods require deletion" logged). They keep the GPU open, k8s-driver-manager cannot unload the driver, the driver pod goes into Init:CrashLoopBackOff and the node ends up in upgrade-failed.

To Reproduce

  1. Run a Deployment whose main container has no GPU request, and a native sidecar with one:
  initContainers:
  - name: gpu-sidecar
    restartPolicy: Always
    resources:
      limits: 
        nvidia.com/gpu: 1
  1. Change driver.version in the ClusterPolicy.
  2. Observe the operator log and the driver pod.

Expected behavior
Pods that declare nvidia.com/gpu* in resources of any container, including native sidecars, are selected by gpuPodSpecFilter and deleted in pod-deletion-required.

Environment (please provide the following information):

  • GPU Operator Version: v26.7.1
  • OS: Ubuntu24.04
  • Kernel Version: 6.17.0-19-generic
  • Container Runtime Version: containerd 2.2.6
  • Kubernetes Distro and Version: K8s v1.36.1
主要语言
Go
星标
3k
派生
592
平均合并
3 天 19 小时
30 天内合并 PR
63

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

NVIDIA/gpu-operator 的其他 Issue

查看 NVIDIA/gpu-operator 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。