kubectl create -f myfirstpod.yaml
error: error validating "myfirstpod.yaml": error validating data: ValidationError(Pod.spec.containers[0].ports[0]): invalid type for io.k8s.api.core.v1.ContainerPort: got "string", expected "map"; if you choose to ignore these errors, turn validation off with --validate=false
This is the error i ran into I searched alot but could not find the answer to this. I think that my yaml format is right.
You need a space after the colon. containerPort: 80
, not containerPort:80
. YAML is whitespace-sensitive.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.