在阿里云托管的k8s上使用nas作动态存储

前言

关于aliyun托管k8s的存储插件主要有两种:html

CSI

# kubectl get pod -n kube-system | grep csi-plugin
csi-plugin-8bbnw                                     9/9     Running     0          26h
csi-plugin-fszg9                                     9/9     Running     0          26h

flexvolume

#  kubectl get pod -n kube-system | grep flexvolume
flexvolume-5fw55                                   1/1     Running            4          288d
flexvolume-992jr                                   1/1     Running            3          288d
flexvolume-f8thl                                   1/1     Running            15         320d
flexvolume-jfzhc                                   1/1     Running            0          6d3h
flexvolume-zjm67                                   1/1     Running            3          152d

插件对比及介绍

详细请看:https://help.aliyun.com/document_detail/157026.html?spm=a2c4g.11186623.6.787.18e320dbvg3zQT网络

两种插件的使用

CSI

https://help.aliyun.com/document_detail/144398.htmlflex

注意:NAS的挂载点要和K8S集群在同一专有网络下阿里云

flexvolume

https://www.yuque.com/docs/share/dcb99888-a491-4802-b321-184bf482f672?# 《在kubernetes集群动态使用nas持久卷》插件

这篇文章要详细的使用案例code

注意

在为阿里云k8s作存储前必定要看清楚使用的是那种存储插件,否则会出现一下问题:htm

pod一直处于ContainerCreating describe查看是由于挂载失败了,大体以下: Warning FailedMount 6m19s (x2 over 13m) kubelet, cn-shenzhen.172.16.0.123 Unable to attach or mount volumes: unmounted volumes=[alicloud-nas], unattached volumes=[default-token-tk4g4 alicloud-nas]: timed out waiting for the conditionblog

image.png

相关文章
相关标签/搜索