【发布时间】:2021-01-12 10:05:59
【问题描述】:
这是我的 firstpod.yaml 文件:
apiVersion: v1
kind: Pod
metadata:
name: webapp
spec:
containers:
- name: webappcontainer
image: richardchesterwood/k8s-fleetman-webapp-angular:release0
我收到以下错误:
error: error validating "firstpod.yaml": error validating data: ValidationError(Pod.spec.containers[0]): invalid type for io.k8s.api.core.v1.Container: got "string", expected "map"; if you choose to ignore these errors, turn validation off with --validate=false"
在线解析器中 yaml 文件的 OUTPUT 格式看起来一切正常。您可以在下面看到在线解析器输出
{
"kind": "Pod",
"spec": {
"containers": [
{
"image": "richardchesterwood/k8s-fleetman-webapp-angular:release0",
"name": "webappcontainer"
}
]
},
"apiVersion": "v1",
"metadata": {
"name": "webapp"
}
}
【问题讨论】:
标签: kubernetes yaml kubectl minikube kubernetes-pod