k8s报错Error: template: nvidia-device-plugin/templates/gfd.yml:22:19: executing "nvidia-device-plugin/templates/gfd.yml" at <.Subcharts.gfd>: nil pointer evaluating interface {}.gfd
前言
在安装 kubernetes 插件 k8s-device-plugin
时,报错:
Error: template: nvidia-device-plugin/templates/gfd.yml:22:19: executing "nvidia-device-plugin/templates/gfd.yml" at <.Subcharts.gfd>: nil pointer evaluating interface {}.gfd
解决
通过查看 helm 发行文档,发现 helm 版本,至少需要 3.7.0 才能使用定义的子图。
https://github.com/helm/helm/releases/tag/v3.7.0
所以需要升级 helm,https://helm.sh/zh/docs/intro/install/
curl https://baltocdn.com/helm/signing.asc | gpg --dearmor | sudo tee /usr/share/keyrings/helm.gpg > /dev/null
sudo apt-get install apt-transport-https --yes
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/helm.gpg] https://baltocdn.com/helm/stable/debian/ all main" | sudo tee /etc/apt/sources.list.d/helm-stable-debian.list
sudo apt-get update
sudo apt-get install helm
打印 helm 版本
# helm version
version.BuildInfo{Version:"v3.14.0", GitCommit:"3fc9f4b2638e76f26739cd77c7017139be81d0ea", GitTreeState:"clean", GoVersion:"go1.21.5"}
helm 安装 nvidia-device-plugin
helm upgrade -i nvdp nvdp/nvidia-device-plugin \
--version=0.13.0 \
--namespace kube-system \
--set gfd.enabled=true \
--set-file config.map.config=timesharing.yaml
又遇到以下问题:
Error: unable to continue with install: CustomResourceDefinition "nodefeaturerules.nfd.k8s-sigs.io" in namespace an exists a nd cannot be imported into the current release : invalid ownership metadata; label validation error: missing key "app.kube rne tes.io/managed-by":must be set to "Helm" ; annotation validation error: missing key "meta.helm.sh/ release-name " :must be set to "nvdp";annotation validation error: missing key "meta.helm. sh/ release-namespace": must be set to "kube-system"
这是因为 CustomResourceDefinition "nodefeaturerules.nfd.k8s-sigs.io" in namespace "an" exists and cannot be imported into the current release
: 此错误表示在当前发布中无法导入已存在的自定义资源定义(CustomResourceDefinition)。可能是由于之前未正确删除该自定义资源定义而导致的冲突。
需要手动删除,已存在的自定义资源定义
kubectl delete crd nodefeaturerules.nfd.k8s-sigs.io
重新安装nvidia-device-plugin
helm upgrade -i nvdp nvdp/nvidia-device-plugin \
--version=0.13.0 \
--namespace kube-system \
--set gfd.enabled=true \
--set-file config.map.config=timesharing.yaml
安装成功
Release "nvdp" does not exist. Installing it now.
NAME: nvdp
LAST DEPLOYED: Tue Jan 30 14:52:17 2024
NAMESPACE: kube-system
STATUS: deployed
REVISION: 1
TEST SUITE: None
通过命令kubectl get pod -n kube-system
查看,如果pod状态为ImagePullBackOff
,这时还需要 docker 手动下载下来,docker load
导入
分类:
kubernetes
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 别再用vector<bool>了!Google高级工程师:这可能是STL最大的设计失误
· 单元测试从入门到精通
2022-01-30 mac、windows 配置python国内镜像源