DirectPV-----文章内容有待进一步实践完善

2022-11-06,,,

GitHub文档地址:https://github.com/minio/directpv

DirectPV是用于直连存储的CSI驱动程序。从更简单的意义上讲,它是一个分布式持久卷管理器,而不是像SAN或NAS这样的存储系统。跨服务器发现、格式化、装载、调度和监视驱动器非常有用。由于Kubernetes hostPath和本地PV是静态配置的,并且功能有限,因此创建DirectPV就是为了解决这一限制。

分布式数据存储(如对象存储、数据库和消息队列)是为直连存储而设计的,它们自行处理高可用性和数据持久性。在传统的SAN或基于NAS的CSI驱动程序(Network PV)上运行它们会在数据路径中添加另一层复制/擦除编码和额外的网络跳数。这种额外的分解层会导致复杂性增加和性能降低。

结构

DirectPV设计为轻量级,可扩展到1000个驱动器中的10个。它由三个组件组成:控制器、节点驱动程序、用户界面

1.控制器

在进行卷声明时,控制器会从无池驱动器统一调配卷。DirectPV知道pod的关联约束,并将卷从本地驱动器分配到pod。请注意,每个群集只运行一个活动的controller实例。

2.节点驱动程序

节点驱动程序实现卷管理功能,例如发现、格式化、装载和监视节点上的驱动器。每个存储服务器上都运行一个节点驱动程序实例。

3.用户界面

存储管理员可以使用kubectl CLI插件来选择、管理和监视驱动器。基于Web的UI目前正在开发中。

Installation

# Install kubectl directpv plugin

# kubectl krew install directpv
Updated the local copy of plugin index.
Installing plugin: directpv
Installed plugin: directpv
\
| Use this plugin:
| kubectl directpv
| Documentation:
| https://github.com/minio/directpv
/
WARNING: You installed plugin "directpv" from the krew-index plugin repository.
These plugins are not audited for security by the Krew maintainers.
Run them at your own risk. # Use the plugin to install directpv in your kubernetes cluster # kubectl directpv install
I0316 10:39:32.252897 26592 install.go:95] Enable dynamic drive change management using --enable-dynamic-discovery flag
W0316 10:39:32.253005 26592 install.go:97] dynamic-discovery feature is strictly experimental and NOT production ready yet
I0316 10:39:32.291954 26592 ns.go:55] 'direct.csi.min.io' namespace created
I0316 10:39:32.339038 26592 rbac.go:352] 'direct.csi.min.io' rbac created
I0316 10:39:32.665041 26592 psp.go:129] 'direct.csi.min.io' podsecuritypolicy created
I0316 10:39:42.759152 26592 conversion_secret.go:170] 'direct.csi.min.io' conversion webhook secrets created
I0316 10:39:42.889964 26592 crd.go:135] crds successfully registered
I0316 10:39:43.113506 26592 csidriver.go:150] 'direct.csi.min.io' csidriver created
I0316 10:39:43.244882 26592 storageclass.go:50] 'direct.csi.min.io' storageclass created
I0316 10:39:43.277386 26592 service.go:39] 'direct.csi.min.io' service created
I0316 10:39:43.335130 26592 daemonset.go:41] 'direct.csi.min.io' daemonset created
I0316 10:39:43.474387 26592 deployment.go:295] 'direct.csi.min.io' deployment created # Ensure directpv has successfully started
# 查看pod创建events,会有报错,才导致info信息没有的
# kubectl directpv info
ERR: directpv installation NOT found run 'kubectl directpv install' to get started
ERROR directpv installation not found # List available drives in your cluster
kubectl directpv drives ls # Select drives that directpv should manage and format
kubectl directpv drives format --drives /dev/sd{a...f} --nodes directpv-{1...4} # 'directpv' can now be specified as the storageclass in PodSpec.VolumeClaimTemplates

DirectPV-----文章内容有待进一步实践完善的相关教程结束。

《DirectPV-----文章内容有待进一步实践完善.doc》

下载本文的Word格式文档,以方便收藏与打印。