美好的一天!
我正在尝试使用头盔地形提供程序设置NVIDIA helm chart的值,但是我无法正确定义变量的名称,某些.tf file
如下所示:
set {
name = "nvidiaInstaller.driverVersion"
value = "${var.driverVersion}"
}
set {
name = "nvidiaInstaller.tag"
value = "${var.tag}"
}
set {
name = "nvidiaInstaller.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms[0].matchExpressions[0].key[0]"
value = "${var.nvidiaInstallerNodeAffinityKey}"
}
set {
name = "nvidiaInstaller.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms[0].matchExpressions[0].operator[1]"
value = "${var.nvidiaInstallerNodeAffinityOperator}"
}
定义值的示例:
variable "driverVersion" {default = 440.31}
variable "tag" {default = "ae3f1b937f784b9e0d18f9dd03b67829381799c9" }
variable "nvidiaInstallerNodeAffinityKey" {default = "gpu"}
variable "nvidiaInstallerNodeAffinityOperator" {default = "In"}
variable "nvidiaInstallerNodeAffinityValues" {default = "nvidia-tesla-t4"}
但是在申请时,我遇到了以下问题:
1 error occurred:
* module.bocr-applications.helm_release.nvidia-gpu-installer: 1 error occurred:
* helm_release.nvidia-gpu-installer: rpc error: code = Unknown desc = release gpu-installer
failed: DaemonSet in version "v1" cannot be handled as a DaemonSet: v1.DaemonSet.Spec:
v1.DaemonSetSpec.Template: v1.PodTemplateSpec.Spec: v1.PodSpec.Affinity:
v1.Affinity.NodeAffinity: v1.NodeAffinity.RequiredDuringSchedulingIgnoredDuringExecution:
v1.NodeSelector.NodeSelectorTerms: []v1.NodeSelectorTerm:
v1.NodeSelectorTerm.MatchExpressions: []v1.NodeSelectorRequirement:
v1.NodeSelectorRequirement.Key: ReadString: expects " or n, but found [, error found in #10
byte of ...|:[{"key":["gpu",null|..., bigger context ...|"nodeSelectorTerms":
[{"matchExpressions":[{"key":["gpu",null,"nvidia-tesla-t4"],"operator":[null,"In|...
有人可以帮助我解决此问题吗?
答案 0 :(得分:0)
该错误可能是少数原因,一个字符不是ascii,null或缩进错误。
helm template
并确认所有字段在输出中都呈现非空值。helm template
验证块是否对齐时,我遇到了一个错误,就像您发布的错误,其中我的块未对齐和/或使用空格/制表符,并引发了该错误 li>
答案 1 :(得分:0)
实际上,上述问题是由于values.yaml文件中key
,operator
和values
的错误覆盖所致。
以下示例的头盔释放集阵列:
set {
name = "nvidiaInstaller.tag"
value = "${var.tag}"
}
set {
name = "nvidiaInstaller.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms[0].matchExpressions[0].key[0]"
value = "${var.nvidiaInstallerNodeAffinityKey}"
}
set {
name = "nvidiaInstaller.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms[0].matchExpressions[0].operator[1]"
value = "${var.nvidiaInstallerNodeAffinityOperator}"
}
应定义如下:
set_string {
name = "nvidiaInstaller.tag"
value = "${var.tag}"
}
set {
name ="nvidiaInstaller.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms[0].matchExpressions[0].key"
value = "${var.nvidiaInstallerNodeAffinityKey}"
}
set {
name ="nvidiaInstaller.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms[0].matchExpressions[0].operator"
value = "${var.nvidiaInstallerNodeAffinityOperator}"
}