Kubernetes的DeploymentConfig的JSON文件无效

问题描述 投票:1回答:1

我有这个从YAML转换的JSON文件:

{
  "kind": "DeploymentConfig",
  "apiVersion": "v1",
  "metadata": {
    "name": "cdt-cae-deployment"
  },
  "spec": {
    "template": {
      "metadata": {
        "labels": {
          "name": "cdt-cae"
        },
        "annotations": {
          "app_version": "latest"
        }
      },
      "spec": {
        "containers": [
          {
            "name": "cdt-cae",
            "image": "containers.nabisco.com/cdt-org/cdt-dev:__IMAGETAG__",
            "ports": [
              {
                "containerPort": 8080,
                "protocol": "TCP"
              }
            ],
            "env": [
              {
                "name": "APP_NAME",
                "value": "cdt-cae"
              },
              {
                "name": "CISCO_LC",
                "value": "dev"
              },
              {
                "name": "OPENSHIFT_MONGODB_DB_USERNAME",
                "value": "cdtdev"
              },
              {
                "name": "OPENSHIFT_MONGODB_DB_PORT",
                "value": "27058"
              },
              {
                "name": "OPENSHIFT_MONGODB_DB_HOST",
                "value": "secret stuff here"
              },
              {
                "name": "OPENSHIFT_MONGODB_DB_PASSWORD",
                "valueFrom": {
                  "secretKeyRef": {
                    "name": "refapp-secret",
                    "key": "mongodb-password"
                  }
                }
              },
              {
                "name": "NOTIFICATIONS_CLIENT_SECRET",
                "valueFrom": {
                  "secretKeyRef": {
                    "name": "refapp-secret",
                    "key": "notifications-client-secret"
                  }
                }
              }
            ],
            "volumeMounts": [
              {
                "name": "podinfo",
                "mountPath": "/etc/metadata",
                "readOnly": false
              }
            ],
            "imagePullPolicy": "IfNotPresent",
            "securityContext": {
              "capabilities": {},
              "privileged": false
            }
          }
        ],
        "volumes": [
          {
            "name": "podinfo",
            "downwardAPI": {
              "items": [
                {
                  "path": "labels",
                  "fieldRef": {
                    "fieldPath": "metadata.labels"
                  }
                },
                {
                  "path": "annotations",
                  "fieldRef": {
                    "fieldPath": "metadata.annotations"
                  }
                }
              ]
            }
          }
        ],
        "restartPolicy": "Always",
        "dnsPolicy": "ClusterFirst"
      }
    },
    "replicas": 3,
    "selector": {
      "name": "cdt-cae"
    },
    "triggers": [
      {
        "type": "ConfigChange"
      }
    ],
    "strategy": {
      "type": "Rolling",
      "rollingParams": {
        "updatePeriodSeconds": 1,
        "intervalSeconds": 1,
        "timeoutSeconds": 120
      }
    }
  }
}

不幸的是,这是无效的JSON - 我收到此消息:

enter image description here

有谁知道配置有什么问题?看起来它实际上是有效的JSON,只是模式可能是错误的..

不介意这只是添加更多细节不要介意这只是添加更多细节不要介意这只是添加更多细节不要介意这只是添加更多细节不要介意这只是添加更多细节不要介意这只是添加更多细节不要介意这只是添加更多细节不要介意这只是添加更多细节不要介意这只是添加更多细节

kubernetes yaml openshift kubectl openshift-enterprise
1个回答
1
投票

<value> expected, unexpected end of file

意味着处理JSON的东西认为缺少终止}。

问题中引用的JSON很好,但由于秘密字段,它已经从原来改变了。也许秘密有一个未转义的引用?

© www.soinside.com 2019 - 2024. All rights reserved.