Rook Ceph Central Storage Cluster 구축하기
Provider Storage Cluster
Reference
- Rook / External Cluster / Export config from the Ceph provider cluster
- Rook GitHub / example toolbox.yaml
- Rook GitHub / example create-external-cluster-resources.py
Provider Storage Cluster의 경우 일반적으로 cephadm으로 구축된다고 안내되어 있습니다.
다른 클러스터가 중앙 스토리지 클러스터의 Ceph daemon에 접근할 수 있어야합니다. 이를 위한 일반적인 설정은 Ceph daemon이 host 네트워크를 사용하는 것입니다.
apiVersion: ceph.rook.io/v1
kind: CephCluster
spec:
network:
provider: host
# ...
필요한 CephFilesystem, CephBlockPool, CephObjectStore 등을 생성합니다.
toolbox=$(kubectl get pod -l app=rook-ceph-tools -n rook-ceph -o jsonpath='{.items[*].metadata.name}')
kubectl -n rook-ceph cp create-external-cluster-resources.py $toolbox:/etc/ceph
python3 create-external-cluster-resources.py \
--namespace rook-ceph \
--rbd-data-pool-name <poolName> \
--cephfs-filesystem-name <filesystemName> \
--rgw-endpoint <ip>:<port> \
--format bash
Consumer Cluster
Reference
apiVersion: ceph.rook.io/v1
kind: CephCluster
metadata:
name: rook-ceph-external
namespace: rook-ceph
spec:
external:
enable: true
crashCollector:
disable: true
healthCheck:
daemonHealth:
mon:
disabled: false
interval: 45s
# optionally, the ceph-mgr IP address can be passed to gather metric from the prometheus exporter
# monitoring:
# enabled: true
# externalMgrEndpoints:
# - ip: ip
# externalMgrPrometheusPort: 9283
Provider Storage Cluster에서 create-external-cluster-resources.py
를 실행해서 얻은 환경 변수를 설정합니다.
export KUBECONFIG=~/.kube/config
export KUBECONTEXT=""
import-external-cluster.sh
파일에서 StorageClass 이름과 관련된 값을 수정하고 아래 명령어를 실행합니다.
. import-external-cluster.sh