相关疑难解决方法(0)

Kubectl始终返回错误:yaml:在此上下文中不允许映射值

Kubectl命令总是返回此错误yaml:第2行:在此上下文中不允许映射值.即使我调用普通版本命令,配置命令等,也不确定是什么造成这种情况.

tessact@tessact-sys-1:~$ kubectl version
Client Version: version.Info{Major:"1", Minor:"4",
GitVersion:"v1.4.4",
GitCommit:"3b417cc4ccd1b8f38ff9ec96bb50a81ca0ea9d56",
GitTreeState:"clean", BuildDate:"2016-10-21T02:48:38Z",
GoVersion:"go1.6.3", Compiler:"gc", Platform:"linux/amd64"}
error: yaml: line 2: mapping values are not allowed in this context


tessact@tessact-sys-1:~/[some path]$ kubectl create -f kubernetes_configs/frontend.yaml
error: yaml: line 2: mapping values are not allowed in this context
Run Code Online (Sandbox Code Playgroud)

我使用的唯一yaml文件是

apiVersion: v1
kind: ReplicationController
metadata:
  name: frontend
  labels:
    name: frontend
spec:
  replicas: 3
  template:
    metadata:
      labels:
        name: frontend
    spec:
      containers:
      - name: trigger
        # Replace  with your project ID or use `make template`
        image: …
Run Code Online (Sandbox Code Playgroud)

yaml kubernetes kubectl

8
推荐指数
2
解决办法
2万
查看次数

标签 统计

kubectl ×1

kubernetes ×1

yaml ×1