apiVersion: rook.io/v1alpha1
kind: Pool
metadata:
name: replicapool
namespace: rook
spec:
replicated:
size: 1
# For an erasure-coded pool, comment out the replication size above and uncomment the following settings.
# Make sure you have enough OSDs to support the replica size or erasure code chunks.
#erasureCoded:
# dataChunks: 2
# codingChunks: 1
---
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: rook-block
provisioner: rook.io/block
parameters:
pool: replicapool
# Specify the Rook cluster from which to create volumes.
# If not specified, it will use `rook` as the name of the cluster.
# This is also the namespace where the cluster will be
clusterName: rook
# Specify the filesystem type of the volume. If not specified, it will use `ext4`.
# fstype: ext4
$ rookctl status
OVERALL STATUS: OK
USAGE:
TOTAL USED DATA AVAILABLE
37.95 GiB 1.50 GiB 0 B 36.45 GiB
MONITORS:
NAME ADDRESS IN QUORUM STATUS
rook-ceph-mon0 10.254.162.99:6790/0 true UNKNOWN
MGRs:
NAME STATUS
rook-ceph-mgr0 Active
OSDs:
TOTAL UP IN FULL NEAR FULL
1 1 1 false false
PLACEMENT GROUPS (0 total):
STATE COUNT
none
$ ceph df
GLOBAL:
SIZE AVAIL RAW USED %RAW USED
38861M 37323M 1537M 3.96
POOLS:
NAME ID USED %USED MAX AVAIL OBJECTS
示例
官方提供了使用rook作为典型的LAMP(Linux + Apache + MySQL + PHP)应用Wordpress的存储后端的示例的yaml文件mysql.yaml和wordpress.yaml,使用下面的命令创建。