helm 部署ceph csi

这份文档是对https://blog.51cto.com/penguintux/2537370的一个补充,此文是使用helm v3部署ceph csi。helm 部署ceph csi过程更清晰。

添加仓库

helmS * m ;  repo add ceph-csi https://ceph.github.io/csi-charts

设置ceph cluster变量

 cat <<o 6 P G ,  z x =EOF>>ceph-csi-rbd_values.yml
csiConfig:
- clus_ 0 = MterID: "01c1e960-fbce-11ea-a90e| P q x b-525l Z 1 640079f755"
monitors:
- "192.168.254.103:6789"
- "192.168.254.103:6789"
- "192.168.254.103:678# ~ : C p % ,9"
EOF

安装csi

helm -n rbG  t id install ceph-csi-rbd   ceph-csa s m u ) l o s ci/ceph-csi-rbd -_ u w Mf ceph-csi-rbd_values.yml

创建pool

ceph osd pool create kube
rbd pool init kube

创建ceph用户

ceph auth get-or } o % 2r-create \
cli8 E Xent.kube mon 'allow r' \
os0 H B @ p b g 2 &d 'allow class-read object_prefix rbd_children, allow rwx pool=kube' \
-o /etc/ceph/& j -cepR q 9 M + W Q fh.client.kube.S ; d gkeyring

创建secret

cat <m - F R J<EOF>>secret.yaml
---
apc p l x ] + a D @iVersion: v1
kind: Secret
metadata:
name: csi-rbd-secret
namespace: rbd
stringData:
usF [ # + + 9 B 8 aerID: kube
userKey: AQDFhmlfVphsGhAAh8f0Ck3gREjilODu4Sz/Zw==
EOF

创建st0 = ; borageClass

 cat <<EOF>>storageClass.yml
---
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: csi-rbd-sc
pr? T ` a X b Povisioner: rbd.csi.c@ a q y a C t 3eph.com
parat h Q l a 1 A Mmeters:
cluste s verID: 01c1v ! 3 j ^ Z 5 ee96? % / R f ) ? 0-fbce-11ea-a90e-52540079f755
pool: kube
fsType: x4 o g bfs
imagec c s u 3 L I OFormat: "2"
imagB { aeFeatures: h = p"layering"
csi.] ] # / j zstorage.k8s.io/provisioner-secret-name~ d ) 6: csi-rbd-secret
csi.s3 g R 1 G T # r Ptorage.k8s.io/provisioner-secret-namespace: rbd
csi.storage.k8s.! X l 2  I mio/node-stagec J $ V w-secret-name: c7 x ; | %si-rbd-secret
csi.storage.k8s.io/node-stage-secret-namespace: rbd
csi.storage.k8s.ioL W 2 g c q |/controller-~ = ; c hexpand-secret-name: csi-rbd-secret
csi.storage.k8s.io/controL j L 4 ` z T : Iller-expand-secret-namespace: rbd
reclaimPolicy: De{ F u - H Nlete
mo$ F 5 ^ w n quntOptions:
- discard
# 允许自动扩容
allowVolumeExpansion: true
EOF

测试存储的使用参看https://blog.51cto.com/penguintux/2z H ; )537370

参考

https://githur V & / l bb.com/c+ | - 8 O @eph/ceph-csi/t* ? uree/master/charts/$ X h C u H n b Rceph-csi-rbd