【问题标题】:Been running into the following error while creating a pod in minikube在 minikube 中创建 pod 时遇到以下错误
【发布时间】:2020-11-02 15:56:09
【问题描述】:
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

这是我遇到的错误 我搜索了很多,但找不到这个问题的答案。 我觉得我的yaml格式是对的。

This is the image of my yaml code

【问题讨论】:

  • 冒号后面需要一个空格。容器端口:80,而不是容器端口:80。 YAML 对空格敏感。

标签: linux kubernetes kubectl minikube kvm


【解决方案1】:

冒号后面需要一个空格。 containerPort: 80,而不是 containerPort:80。 YAML 对空格敏感。

【讨论】:

    猜你喜欢
    • 2021-12-23
    • 1970-01-01
    • 2019-11-26
    • 2023-01-30
    • 1970-01-01
    • 2019-09-13
    • 2019-06-24
    • 2019-02-15
    • 2021-05-15
    相关资源
    最近更新 更多