sfgroups
sfgroups

Reputation: 19119

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. 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

Upvotes: 5

Views: 12692

Answers (1)

monis
monis

Reputation: 494

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

Upvotes: 1

Related Questions