该仓库包含Gluster的CSI(容器存储接口)驱动。容器存储接口(CSI)是一种行业标准,旨在实现集群级卷插件的标准化,使存储供应商(SP)只需开发一次插件,即可在多个容器编排(CO)系统中使用。
本仓库包含源代码和Dockerfile用于构建GlusterFS CSI驱动,采用多阶段容器构建方式,需使用较新版本的Docker或Buildah。
克隆仓库并进入目录:
bash[root@localhost]# git clone https://github.com/gluster/gluster-csi-driver.git [root@localhost]# cd gluster-csi-driver
运行构建脚本:
bash[root@localhost]# ./build.sh
使用CSI驱动前需完成以下环境准备:
注意:可通过https://github.com/gluster/gcs%E5%B7%A5%E5%85%B7%E4%B8%80%E9%94%AE%E9%83%A8%E7%BD%B2%E4%B8%8A%E8%BF%B0%E7%8E%AF%E5%A2%83%EF%BC%8C%E6%97%A0%E9%9C%80%E5%88%86%E5%88%AB%E5%AE%89%E8%A3%85%E3%80%82%E8%AF%A6%E6%83%85%E5%8F%82%E8%A7%81https://github.com/gluster/gcs/blob/master/deploy/README.md%E3%80%82
部署CSI组件
bash[root@localhost]# cd examples/kubernetes/gluster-virtblock/ [root@localhost]# kubectl create -f csi-deployment.yaml service/csi-attacher-glustervirtblockplugin created statefulset.apps/csi-attacher-glustervirtblockplugin created daemonset.apps/csi-nodeplugin-glustervirtblockplugin created service/csi-provisioner-glustervirtblockplugin created statefulset.apps/csi-provisioner-glustervirtblockplugin created serviceaccount/glustervirtblock-csi created clusterrole.rbac.authorization.k8s.io/glustervirtblock-csi created clusterrolebinding.rbac.authorization.k8s.io/glustervirtblock-csi-role created
创建存储类
yaml# storage-class.yaml apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: name: glustervirtblock-csi annotations: storageclass.kubernetes.io/is-default-class: "false" provisioner: org.gluster.glustervirtblock
bash[root@localhost]# kubectl create -f storage-class.yaml storageclass.storage.k8s.io/glustervirtblock-csi created
验证存储类创建:
bash[root@localhost]# kubectl get storageclass NAME PROVISIONER AGE glustervirtblock-csi org.gluster.glustervirtblock 6s
创建PersistentVolumeClaim (PVC)
yaml# pvc.yaml kind: PersistentVolumeClaim apiVersion: v1 metadata: name: glusterblock-csi-pv spec: storageClassName: glustervirtblock-csi accessModes: - ReadWriteOnce resources: requests: storage: 100Mi
bash[root@localhost]# kubectl create -f pvc.yaml persistentvolumeclaim/glusterblock-csi-pv created
验证PVC状态:
bash[root@localhost]# kubectl get pvc NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE glusterblock-csi-pv Bound pvc-1048edfb-1f06-11e9-8b7a-525400491c42 100Mi RWO glustervirtblock-csi 8s
创建使用PVC的Pod
yaml# app.yaml apiVersion: v1 kind: Pod metadata: name: gluster-0 labels: app: gluster spec: containers: - name: gluster image: redis imagePullPolicy: IfNotPresent volumeMounts: - mountPath: "/mnt/gluster" name: glusterblockcsivol volumes: - name: glusterblockcsivol persistentVolumeClaim: claimName: glusterblock-csi-pv
bash[root@localhost]# kubectl create -f app.yaml pod/gluster-0 created
验证Pod状态及挂载:
bash[root@localhost]# kubectl get pods NAME READY STATUS RESTARTS AGE gluster-0 1/1 Running 0 38s [root@localhost]# kubectl exec -it gluster-0 -- mount | grep gluster /mnt/blockhostvol/block_hosting_volume_ddd7ced7-7766-4797-9214-01fa9587472a/pvc-1048edfb-1f06-11e9-8b7a-525400491c42 on /mnt/gluster type xfs (rw,relatime,seclabel,attr2,inode64,noquota)
部署CSI组件
bash[root@localhost]# kubectl create -f csi-deployment.yaml service/csi-attacher-glusterfsplugin created statefulset.apps/csi-attacher-glusterfsplugin created daemonset.apps/csi-nodeplugin-glusterfsplugin created service/csi-provisioner-glusterfsplugin created statefulset.apps/csi-provisioner-glusterfsplugin created serviceaccount/glusterfs-csi created clusterrole.rbac.authorization.k8s.io/glusterfs-csi created clusterrolebinding.rbac.authorization.k8s.io/glusterfs-csi-role created
注意:Kubernetes v1.13.1需启用特性门控:
--feature-gates=VolumeSnapshotDataSource=true
创建存储类
yaml# storage-class.yaml apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: name: glusterfs-csi annotations: storageclass.kubernetes.io/is-default-class: "true" provisioner: org.gluster.glusterfs
bash[root@localhost]# kubectl create -f storage-class.yaml storageclass.storage.k8s.io/glusterfs-csi created
创建PVC及Pod
步骤与RWO类似,PVC访问模式指定为ReadWriteMany,详细操作参见RWO卷声明部分。
yaml# snapshot-class.yaml apiVersion: snapshot.storage.k8s.io/v1alpha1 kind: VolumeSnapshotClass metadata: name: glusterfs-csi-snap snapshotter: org.gluster.glusterfs
bash[root@localhost]# kubectl create -f snapshot-class.yaml volumesnapshotclass.snapshot.storage.k8s.io/glusterfs-csi-snap created
yaml# volume-snapshot.yaml apiVersion: snapshot.storage.k8s.io/v1alpha1 kind: VolumeSnapshot metadata: name: glusterfs-csi-ss spec: snapshotClassName: glusterfs-csi-snap source: name: glusterfs-csi-pv kind: PersistentVolumeClaim
bash[root@localhost]# kubectl create -f volume-snapshot.yaml volumesnapshot.snapshot.storage.k8s.io/glusterfs-csi-ss created
yaml# pvc-restore.yaml apiVersion: v1 kind: PersistentVolumeClaim metadata: name: glusterfs-pv-restore spec: storageClassName: glusterfs-csi dataSource: name: glusterfs-csi-ss kind: VolumeSnapshot apiGroup: snapshot.storage.k8s.io accessModes: - ReadWriteMany resources: requests: storage: 5Gi
bash[root@localhost]# kubectl create -f pvc-restore.yaml persistentvolumeclaim/glusterfs-pv-restore created
创建支持Thin Arbiter的存储类:
yaml# thin-arbiter-virtblock-storageclass.yaml apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: name: glustervirtblock-csi-thin-arbiter provisioner: org.gluster.glustervirtblock parameters: replicas: "2" arbiterType: "thin" arbiterPath: "192.168.122.121:/mnt/arbiter-path:24007"
使用loopback设备作为brick的存储类:
yaml# glusterfs-lite-storage-class.yaml apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: name: glusterfs-lite-csi provisioner: org.gluster.glusterfs parameters: brickType: "loop"
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
探索更多轩辕镜像的使用方法,找到最适合您系统的配置方式
通过 Docker 登录认证访问私有仓库
无需登录使用专属域名
Kubernetes 集群配置 Containerd
K3s 轻量级 Kubernetes 镜像加速
VS Code Dev Containers 配置
Podman 容器引擎配置
HPC 科学计算容器配置
ghcr、Quay、nvcr 等镜像仓库
Harbor Proxy Repository 对接专属域名
Portainer Registries 加速拉取
Nexus3 Docker Proxy 内网缓存
需要其他帮助?请查看我们的 常见问题Docker 镜像访问常见问题解答 或 提交工单
docker search 限制
站内搜不到镜像
离线 save/load
插件要用 plugin install
WSL 拉取慢
安全与 digest
新手拉取配置
镜像合规机制
manifest unknown
no matching manifest(架构)
invalid tar header(解压)
TLS 证书失败
DNS 超时
域名连通性排查
410 Gone 排查
402 与流量用尽
401 认证失败
429 限流
D-Bus 凭证提示
413 与超大单层
来自真实用户的反馈,见证轩辕镜像的优质服务