The rook
client tool can be used to manage your Rook cluster once it is running as well as manage block, file and object storage. See the sections below for details on how to configure each type of storage.
If you don't yet have a Rook cluster running, refer to our Quickstart Guides.
-
Create a new volume image (10MB)
$ rook block create --name test --size 10485760
-
Mount the block volume and format it
sudo -E rook block mount --name test --path /tmp/rook-volume sudo chown $USER:$USER /tmp/rook-volume
-
Write and read a file
echo "Hello Rook!" > /tmp/rook-volume/hello cat /tmp/rook-volume/hello
-
Cleanup
sudo rook block unmount --path /tmp/rook-volume
-
Create a shared file system
rook filesystem create --name testFS
-
Verify the shared file system was created
rook filesystem ls
-
Mount the shared file system from the cluster to your local machine
rook filesystem mount --name testFS --path /tmp/rookFS sudo chown $USER:$USER /tmp/rookFS
-
Write and read a file to the shared file system
echo "Hello Rook!" > /tmp/rookFS/hello cat /tmp/rookFS/hello
-
Unmount the shared file system (this does not delete the data from the cluster)
rook filesystem unmount --path /tmp/rookFS
-
Cleanup the shared file system from the cluster (this does delete the data from the cluster)
rook filesystem delete --name testFS
-
Create an object storage instance in the cluster
rook object create
-
Create an object storage user
rook object user create rook-user "A rook rgw User"
-
Get the connection information for accessing object storage
eval $(rook object connection rook-user --format env-var)
-
Use an S3 compatible client to create a bucket in the object store
s3cmd mb --no-ssl --host=${AWS_ENDPOINT} --host-bucket= s3://rookbucket
-
List all buckets in the object store
s3cmd ls --no-ssl --host=${AWS_ENDPOINT} --host-bucket=
-
Upload a file to the newly created bucket
echo "Hello Rook!" > /tmp/rookObj s3cmd put /tmp/rookObj --no-ssl --host=${AWS_ENDPOINT} --host-bucket= s3://rookbucket
-
Download and verify the file from the bucket
s3cmd get s3://rookbucket/rookObj /tmp/rookObj-download --no-ssl --host=${AWS_ENDPOINT} --host-bucket= cat /tmp/rookObj-download