简体   繁体   English

Kubernetes错误json:无法将字符串解组为map [string] interface {}类型的Go值

[英]Kubernetes error json: cannot unmarshal string into Go value of type map[string]interface {}

I am trying to execute this rolling update example in v1.6.2 cluster. 我正在尝试在v1.6.2集群中执行此滚动更新示例。 my kubectl command giving this error message. 我的kubectl命令给出了这个错误信息。

Error from server: json: cannot unmarshal string into Go value of type map[string]interface {}

Here is the YMAL file from this page: https://www.mirantis.com/blog/scaling-kubernetes-daemonsets/ 这是此页面上的YMAL文件: https : //www.mirantis.com/blog/scaling-kubernetes-daemonsets/

apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
  name: frontend
spec:
  updateStrategy: RollingUpdate
    maxUnavailable: 1
    minReadySeconds: 0
  template:
    metadata:
      labels:
        app: frontend-webserver
    spec:
      nodeSelector:
        app: frontend-node
      containers:
        - name: webserver
          image: nginx
          ports:
          - containerPort: 80

How to resolve this error? 如何解决这个错误?

Thanks SR 谢谢SR

The updateStrategy appears to be incorrect: updateStrategy似乎不正确:

apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
  name: frontend
spec:
  updateStrategy:
    type: RollingUpdate
    maxUnavailable: 1
  template:
    metadata:
      labels:
        app: frontend-webserver
    spec:
      nodeSelector:
        app: frontend-node
      containers:
        - name: webserver
          image: nginx
          ports:
          - containerPort: 80

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 json:无法将字符串解组为 map[string]interface {} 类型的 Go 值 - json: cannot unmarshal string into Go value of type map[string]interface {} json:无法将字符串解组为 MyMap.map 类型的 Go 值 - json: cannot unmarshal string into Go value of type MyMap.map json:无法将字符串解组为[] main.KVU类型的Go值 - json: cannot unmarshal string into Go value of type []main.KVU 去解组反射。类型得到map [string] interface {} - Go Unmarshal reflect.Type got map[string]interface{} 使用Web GUI的Bluemix部署错误:失败来自服务器的无效JSON响应:JSON:无法将数字解组为字符串类型的Go值 - Bluemix deployment error using web gui: FAILED Invalid JSON response from server: json: cannot unmarshal number into Go value of type string Go是否可以解组地图[string] [] interface {}? - Is Go able to unmarshal to map[string][]interface{}? json:无法将数字解组为 Go 结构字段。字符串类型的数量 - json: cannot unmarshal number into Go struct field .Amount of type string Golang - 无法将数字解组为字符串类型的 Go 值 - Golang - Cannot unmarshal number into Go value of type string json:无法将字符串解组为main.test_struct类型的Go值 - json: cannot unmarshal string into Go value of type main.test_struct 无法将字符串解组为 int64 类型的 Go 值 - Cannot unmarshal string into Go value of type int64
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM