//参考文档
https://rook.io/docs/rook/v1.0/ceph-examples.html
下载rook 项目
https://github.com/rook/rook
部署
cd cluster/examples/kubernetes/ceph
kubectl create -f common.yaml
kubectl create -f operator.yaml
kubectl create -f cluster-test.yaml
连接验证
kubectl create -f toolbox.yaml
kubectl -n rook-ceph get pod -l "app=rook-ceph-tools"
保证状态running进入容器:
kubectl -n rook-ceph exec -it $(kubectl -n rook-ceph get pod -l "app=rook-ceph-tools" -o jsonpath='{.items[0].metadata.name}') bash
验证命令
ceph status
ceph osd status
ceph df
rados df
删除连接工具
kubectl -n rook-ceph delete deployment rook-ceph-tools
Block Storage 部署测试
部署pool 和storageclass
.rook-release-1.0/cluster/examples/kubernetes/ceph/storageclass-test.yaml
mysql wordpress 项目验证
.rook-release-1.0/cluster/examples/kubernetes/mysql.yaml
.rook-release-1.0/cluster/examples/kubernetes/wordpress.yaml
Object Storage 部署测试
创建对象存储
.rook-release-1.0/cluster/examples/kubernetes/ceph/object-test.yaml
确保rgw pod 运行正常
kubectl -n rook-ceph get pod -l app=rook-ceph-rgw
创建对象存储用户
kubectl create -f object-user.yaml
获取 AccessKey and SecretKey
kubectl -n rook-ceph get secret rook-ceph-object-user-my-store-my-user -o yaml | grep AccessKey | awk '{print 2}' | base64 --decode
验证对象存储:
进入toolbox 容器 kubectl -n rook-ceph exec -it $(kubectl -n rook-ceph get pod -l "app=rook-ceph-tools" -o jsonpath='{.items[0].metadata.name}') bash
参考: https://rook.io/docs/rook/v1.0/ceph-toolbox.html
install s3cmd:
yum --assumeyes install s3cmd
export AWS_HOST=
export AWS_ENDPOINT=
export AWS_ACCESS_KEY_ID=
export AWS_SECRET_ACCESS_KEY=
创建桶
s3cmd mb --no-ssl --host={AWS_HOST}
上传对象:
echo "Hello Rook" > /tmp/rookObj
s3cmd put /tmp/rookObj --no-ssl --host={AWS_HOST} --host-bucket=
cat /tmp/rookObj-download
部署测试Shared File System (共享文件存储)
创建文件存储对象
.rook-release-1.0/cluster/examples/kubernetes/ceph/filesystem-test.yaml
验证mds 启动pod正常
kubectl -n rook-ceph get pod -l app=rook-ceph-mds
connect to the Rook toolbox, $ ceph status
Create the directory
mkdir /tmp/registry
Detect the mon endpoints and the user secret for the connection
mon_endpoints=3}')
my_secret=3}')
Mount the file system
mount -t ceph -o mds_namespace=myfs,name=admin,secret=mon_endpoints:/ /tmp/registry
See your mounted file system
df -h