【发布时间】:2019-06-12 17:08:13
【问题描述】:
apiVersion: v1
kind: Pod
metadata:
creationTimestamp: null
labels:
run: nginx4
name: nginx4
spec:
containers:
- image: nginx
name: nginx4
nodeSelector:
app: "v1-tesla"
resources: {}
dnsPolicy: ClusterFirst
restartPolicy: Never
status: {}
当我运行上面的模板 kubectl create -f pod.yaml 时,我得到以下错误:
error: error validating "podOnANode.yaml": error validating data:
ValidationError(Pod.spec.nodeSelector.resources): invalid type for
io.k8s.api.core.v1.PodSpec.nodeSelector: got "map", expected
"string"; if you choose to ignore these errors, turn validation off
with --validate=false
任何解决此问题的指针都会很棒。
【问题讨论】:
标签: kubernetes yaml nodes kubectl kubernetes-pod