You are viewing a single comment's thread from:

RE: 用 ConfigMap 管理应用的配置信息 — Kubernetes(46)

in #kubernetes7 years ago

wty@master:~/kubernetes/secret/configmap$ kubectl apply -f my-configmap.yml
Error from server (BadRequest): error when creating "my-configmap.yml": ConfigMap in version "v1" cannot be handled as a ConfigMap: v1.ConfigMap: Data: ReadString: expects " or n, parsing 55 ...config2":8... at {"apiVersion":"v1","data":{"config1":"test","config2":80},"kind":"ConfigMap","metadata":{"annotations":{"kubectl.kubernetes.io/last-applied-configuration":"{"apiVersion":"v1","data":{"config1":"test","config2":80},"kind":"ConfigMap","metadata":{"annotations":{},"name":"myconfigmap","namespace":"default"}}\n"},"name":"myconfigmap","namespace":"default"}}

wty@master:~/kubernetes/secret/configmap$ cat my-configmap.yml
apiVersion: v1
kind: ConfigMap
metadata:
name: myconfigmap
data:
config1: "test"
config2: 80
大佬 为什么yaml的configmap创建不了呢
我的版本是1.9.5