Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use rook-edgefs in kubernetes

2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

It is believed that many inexperienced people have no idea about how to use rook-edgefs in kubernetes. Therefore, this article summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.

Environment ubuntu20 server, kubernetes 1.18cm, rook 1.4, mirrored scientific environment

The stable storage schemes supported by the rook directory are ceph and edgefs. Edgefs used, but also feel more eat memory and cpu, now Deprecated, do not use. Reference https://rook.io/docs/rook/v1.4/edgefs-quickstart.html

Configure the system sudo vi / etc/sysctl.conf

Net.core.rmem_default = 80331648net.core.rmem_max = 80331648net.core.wmem_default = 33554432net.core.wmem_max = 50331648vm.dirty_ratio = 10vm.dirty_background_ratio = 5vm.swappiness = 15

Make it effective sudo sysctl-p

Create a simple EdgeFS Rook cluster. Edit the cluster.yaml file according to the actual situation, with comments in the document. For example, dataDirHostPath: / data sysRepCount: 2, refer to https://rook.io/docs/rook/v1.4/edgefs-cluster-crd.html

# first create the directory sudo mkdir / datagit clone-- single-branch-- branch release-1.4 https://github.com/rook/rook.gitcd rook/cluster/examples/kubernetes/edgefskubectl create-f operator.yamlkubectl create-f cluster.yaml specified by dataDirHostPath

View the cluster running status. Running result, the status must be Running

$kubectl-n rook-edgefs-system get pod-o wideNAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATESrook-discover-nhxv4 1 Running 0 2m3s 10.244.1.98 ser40 rook-discover-tprdl 1 Running 0 2m3s 10.244.0.162 ser30 rook-discover-wlgvz 1 Running 0 2m3s 10.244.2.24 ser50 rook-edgefs-operator-5d49489dbd-jqzgb 1 Running 0 2m44s 10.244.1.97 ser40 $kubectl-n rook-edgefs get podNAME READY STATUS RESTARTS AGErook-edgefs-mgr-648457b454-s2hkr 3/3 Running 0 8m55srook-edgefs-target-0 3/3 Running 0 8m55srook-edgefs-target-1 3/3 Running 0 8m55s

Initialize EdgeFS https://rook.io/docs/rook/v1.4/edgefs-iscsi-crd.html

Kubectl get po-- all-namespaces | grep edgefs-mgrkubectl exec-it-n rook-edgefs rook-edgefs-mgr-648457b454-s2hkr-- env COLUMNS=$COLUMNS LINES=$LINES TERM=linux toolbox

6.0 View Node status

Efscli system status

6.1 initialize the EdgeFS cluster

Efscli system init

6.2 create a new local namespace

Efscli cluster create Hawaii

6.3 create a logical tenant of the cluster namespace "Hawaii" and store it if necessary

Efscli tenant create Hawaii/Pepsiefscli bucket create Hawaii/Pepsi/bk1

6.4.When creating a service isc-pepsi, you need to use

Efscli service create iscsi isc-pepsiefscli service serve isc-pepsi Hawaii/Pepsi/bk1/lun1 X-volsize=20G

6.5 after the cluster is running, create NFS,SMB,S3 or iSCSI storage for use by other applications in the cluster. This example uses iSCSI with specific requirements. Isc-pepsi created with a name attribute of 6. 4

# cd rook/cluster/examples/kubernetes/edgefs# modifies name in sudo vi iscsi.yaml to 6.4.The defined serviceapiVersion: edgefs.rook.io/v1kind: ISCSImetadata: name: isc-pepsi # this name has to match efscli service namespace: rook-edgefs# App modifies kubectl create-f iscsi.yaml

Create csi interface https://rook.io/docs/rook/v1.4/edgefs-csi.html

If you have a lower version of kubernetes, you need to turn on some feature gates. Refer to https://kubernetes.io/zh/docs/reference/command-line-tools-reference/feature-gates/. The 1.8 meters used in this example do not need to be changed.

7.1 Kubernetes CSI drivers require CSIDriver and CSINodeInfo resource types to be defined on the cluster. Check if they are already defined:

Kubectl get customresourcedefinition.apiextensions.k8s.io/csidrivers.csi.storage.k8s.iokubectl get customresourcedefinition.apiextensions.k8s.io/csinodeinfos.csi.storage.k8s.io

Does not exist, creatin

Kubectl create-f https://raw.githubusercontent.com/kubernetes/csi-api/release-1.13/pkg/crd/manifests/csidriver.yamlkubectl create-f https://raw.githubusercontent.com/kubernetes/csi-api/release-1.13/pkg/crd/manifests/csinodeinfo.yaml

7.2 installation tools, ubuntu20.04 server is installed by default

Apt install-y open-iscsi

7. 3 create the ISCSI driver, which I put under the rook-edgefs namespace. You need to edit the default namespace in edgefs-iscsi-csi-driver.yaml to rook-edgefs

Cd cluster/examples/kubernetes/edgefs/csi/iscsikubectl create ns rook-edgefs-csikubectl-n rook-edgefs-csi create secret generic edgefs-iscsi-csi-driver-config-- from-file=./edgefs-iscsi-csi-driver-config.yamlkubectl-n rook-edgefs-csi apply-f edgefs-iscsi-csi-driver.yaml

View the result

Kubectl get pods-n rook-edgefs-csiNAME READY STATUS RESTARTS AGEedgefs-iscsi-csi-controller-0 4 11medgefs-iscsi-csi-node-4f57b 4 Running 0 11medgefs-iscsi-csi-node-4f57b 2 Running 8 11medgefs-iscsi-csi-node-lbgkp 2 11medgefs-iscsi-csi-node-qnjvn 2 Running 2 11medgefs-iscsi-csi-node-qnjvn 2 Running 6 11m

Create a dynamic provisioned volume. Parameters is created in step 6, to correspond to

ApiVersion: storage.k8s.io/v1kind: StorageClassmetadata: name: edgefs-iscsi-csi-storageclassprovisioner: io.edgefs.csi.nfsparameters: segment: rook-edgefs service: isc-pepsi cluster: Hawaii tenant: pepsi bucket: bk1

Use the StorageClass you just created

After reading the above, have you mastered how to use rook-edgefs in kubernetes? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report