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

6/1/2017

I am trying to execute this rolling update example in v1.6.2 cluster. my kubectl command giving this error message.

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/

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

-- sfgroups
json
kubernetes

1 Answer

6/2/2017

The updateStrategy appears to be incorrect:

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
-- monis
Source: StackOverflow