<p>I want to start learning to deploy longhorn to my exixting on-perm kubernetes</p>
<p>As in <a href="https://longhorn.io/docs/1.3.1/advanced-resources/default-disk-and-node-config/#launch-longhorn-with-multiple-disks" rel="nofollow noreferrer">https://longhorn.io/docs/1.3.1/advanced-resources/default-disk-and-node-config/#launch-longhorn-with-multiple-disks</a> , I need to add some annotations to the node</p>
<p>I try to use 'merge' as stated in <a href="https://kubernetes.io/docs/tasks/manage-kubernetes-objects/update-api-object-kubectl-patch/#use-a-json-merge-patch-to-update-a-deployment" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/manage-kubernetes-objects/update-api-object-kubectl-patch/#use-a-json-merge-patch-to-update-a-deployment</a></p>
<p>Here is my patch file (lhpatch.yaml)</p>
<pre><code>metadata:
  annotations:
    node.longhorn.io:
      default-disks-config:
      - path: /mnt/lh01
        allowSheduling: true
      - path: /mnt/lh02
        allowSheduling: true
</code></pre>
<p>Apply it:</p>
<pre><code>kubectl patch node k8s-worker-1 --type merge --patch-file /home/bino/k0s-sriwijaya/longhorn/lhpatch.yaml
</code></pre>
<p>But I got error (at the last line of results):</p>
<pre><code>json: cannot unmarshal object into Go struct field ObjectMeta.metadata.annotations of type string
</code></pre>
<p>Kindly please tell me how to fix my lhpatch.yaml</p>
<p>Sincerely</p>
<p>-bino-</p>

Bino Oetomo
<p>You should use:</p>
<pre><code>metadata:
  annotations:
    node.longhorn.io:
      default-disks-config:
      - path: /mnt/lh01
        allowSheduling: 'true'
      - path: /mnt/lh02
        allowSheduling: 'true'
</code></pre>
<p>Since in annotations you can't refer to boolean types, and instead you should pass with <code>string: string</code>.</p>
