Simple Longhorn dedicated nodes

Jbn1233
Feb 13, 2022

--

To run Longhorn storage only on the specific nodes:

  • Download specific version yaml from:
https://raw.githubusercontent.com/longhorn/longhorn/v1.x.x/deploy/longhorn.yaml
  • Append new data to longhorn-default-setting ConfigMap
# Source: longhorn/templates/default-setting.yaml
apiVersion: v1
kind: ConfigMap
metadata:
data:
default-setting.yaml: |-
create-default-disk-labeled-nodes: "true"
  • Apply yaml
  • Add label node.longhorn.io/create-default-disk=true to your dedicated storage nodes. Do nothing on another node.
kubectl patch nodes xxxx -p '{"metadata":{"labels":{"node.longhorn.io/create-default-disk":"true"}}}'
  • Done
node 001–003 are storage nodes and others are compute node

For better result, you may apply taint to Longhorn nodes

That’s all

--

--

Jbn1233
Jbn1233

Written by Jbn1233

Very short and simple notes for CKA/SRE and may not works on your environment | jbn1233@gmail.com | Bangkok, Thailand |

No responses yet