This guide will walk you through the basic setup of a Ceph cluster and enable you to consume block, object, and file storage from other pods running in your cluster.html
Rook支持的Kubernetes 要求版本高於 v1.7。git
確保 Kubernetes 集羣能夠用於 Rook
, 跟着這個檢查 follow these instructions.github
若是使用 dataDirHostPath
來持久化 rook 到 kubernetes 的宿主機,確保 host 至少有 5GB 以上空間可用,並且是指定的目錄下。api
若是幸運的話,Rook cluster 能夠經過下面的kubectl commands來建立。更多細節,參考 deploy the Rook operator。網絡
cd cluster/examples/kubernetes/ceph kubectl create -f operator.yaml kubectl create -f cluster.yaml
集羣運行後,就能夠建立 block, object, or file 存儲,從而能夠被集羣中其它的應用所使用。框架
這是部署Rook system components,的第一步,包括一個Rook agent運行於每個節點上,做爲Rook operator pod,缺省部署在rook-ceph-system命名空間中。分佈式
cd cluster/examples/kubernetes/ceph kubectl create -f operator.yaml # verify the rook-ceph-operator, rook-ceph-agent, and rook-discover pods are in the `Running` state before proceeding kubectl -n rook-ceph-system get pod
該operator能夠經過 Rook Helm Chart 來進行部署。ide
對於Kubernetes 1.8以前的版本, Kubelet 進程在全部的節點上都要進行重啓,在部署Rook operator 和 Rook agents以後。做爲初始化 setup的一部分, Rook agents 部署和配置了Flexvolume plugin ,以此與 Kubernetes’ volume controller框架整合。在 Kubernetes v1.8+, 其 dynamic Flexvolume plugin discovery 將會發現和初始化Rook的plugin, 但在 Kubernetes的老版本上,手工重啓Kubelet被要求。工具
如今Rook operator, agent,和 discover pods已經運行,咱們能夠建立 Rook cluster。爲了重啓以後還能復活集羣,請肯定設置了dataDirHostPath
屬性。更多的設置,參考 configuring the cluster.測試
保存下面的參數爲 cluster.yaml
:
apiVersion: v1 kind: Namespace metadata: name: rook-ceph --- apiVersion: ceph.rook.io/v1beta1 kind: Cluster metadata: name: rook-ceph namespace: rook-ceph spec: dataDirHostPath: /var/lib/rook dashboard: enabled: true storage: useAllNodes: true useAllDevices: false config: databaseSizeMB: "1024" journalSizeMB: "1024"
建立cluster:
kubectl create -f cluster.yaml
使用 kubectl
列出rook命名空間下的 pods 。其中,osd pods 的數量依賴於集羣中節點的數量、配置的設備和目錄的數量。
$ kubectl -n rook-ceph get pod NAME READY STATUS RESTARTS AGE rook-ceph-mgr-a-75cc4ccbf4-t8qtx 1/1 Running 0 24m rook-ceph-mon0-72vx7 1/1 Running 0 25m rook-ceph-mon1-rrpm6 1/1 Running 0 24m rook-ceph-mon2-zff9r 1/1 Running 0 24m rook-ceph-osd-id-0-5fd8cb9747-dvlsb 1/1 Running 0 23m rook-ceph-osd-id-1-84dc695b48-r5mhf 1/1 Running 0 23m rook-ceph-osd-id-2-558878cd84-cnp67 1/1 Running 0 23m rook-ceph-osd-prepare-minikube-wq4f5 0/1 Completed 0 24m
瞭解Rook提供的三種不一樣存儲類型,查看指南:
Ceph 有一個dashboard服務,依賴於mgr的指標收集。能夠查看集羣的狀態,參見 dashboard guide 。也能夠經過安裝集成的Prometheus和Grafana來查看運行狀態。
咱們建立了一個toolbox container,裏面包含全功能的Ceph clients命令行工具,能夠用於調試和診斷Rook集羣的狀態和錯誤。 查看 toolbox readme 得到安裝和用法的信息。同時,查看 advanced configuration 文檔查看維護和調優的例子。
每個 Rook cluster 都有內置的 metrics collectors/exporters用於 Prometheus 的監測。瞭解如何設置 monitoring,請查看 monitoring guide。
測試完集羣后,查看 these instructions 能夠將其清除。