NodeResourceManager

abstract

Node-resource-manager is a component used to manage local resources in an OpenYurt cluster, user can dynamically configure local resources on hosts in a cluster by modifying a ConfigMap resource.

Node-resource-manager can initialize an existing block device or persistent memory device on the host into the following two local storage devices:

  • An LVM created based on a block device or persistent memory device
  • QuotaPath created on a block device or persistent memory device

Any changes to ConfigMap will be treated as changes to local resources on woker nodes in the cluster. For data security reasons, the plug-in will not delete any local resources

At the same time, with csi component, local storage devices can be used quickly and easily in Openyurt cluster.

architecture

This component consists of two main parts, one is the Node-resource-Topo ConfigMap defined in the kube-system namespace in the cluster, One is the Node-Resource-manager Daemonset, which is deployed under the Kube-system namespace in the cluster. The Node-resource-manager on each Node produces and manages user-defined local resources by mounting node-resource-Topo ConfigMap.

img

samples

Create Configmap

Create a ConfigMap in a cluster. This section shows a generic ConfigMap configuration. For details, see https://github.com/openyurtio/node-resource-manager/blob/main/docs/configmap.zh.md

  1. apiVersion: v1
  2. kind: ConfigMap
  3. metadata:
  4. name: node-resource-topo
  5. namespace: kube-system
  6. data:
  7. volumegroup: |-
  8. volumegroup:
  9. - name: volumegroup1
  10. key: kubernetes.io/hostname
  11. operator: In
  12. value: cn-zhangjiakou.192.168.3.114
  13. topology:
  14. type: device
  15. devices:
  16. - /dev/vdb
  17. - /dev/vdc
  18. quotapath: |-
  19. quotapath:
  20. - name: /mnt/path1
  21. key: kubernetes.io/hostname
  22. operator: In
  23. value: cn-beijing.192.168.3.35
  24. topology:
  25. type: device
  26. options: prjquota
  27. fstype: ext4
  28. devices:
  29. - /dev/vdb

The previous configuration provides the following functions

  • In the test cluster, we used two pieces of equipment : /dev/VDB & / dev/VDC to create an LVM volumegroup on the worker node: “cn - zhangjiakou. 192.168.3.114 “. Devices here can add paths that do not exist, because the plug-in will automatically ignore this path during the node initialisation .
  • Meanwhile, we format the block device “/dev/vdb” to prjquota format on worker node “cn-beijing.192.168.3.35”, and mount it to path “/mnt/path1”, and then subdirectories created under this path can set the maximum quota for each directory. Devices here can also add paths that do not exist, the component will automatically select the first existing block device for formatting and binding.

Installation of node-resource-manager

  1. kubectl apply -f https://raw.githubusercontent.com/openyurtio/node-resource-manager/main/deploy/nrm.yaml

Best practices of Edge local storage

https://help.aliyun.com/document_detail/294460.html?spm=5176.2020520152.help.dexternal.52a116ddm4F9Z4