Skip to content

Instantly share code, notes, and snippets.

@resouer
Created January 20, 2018 01:10
Show Gist options
  • Select an option

  • Save resouer/2b45b9dbcaf29681ebfead77459c0cd9 to your computer and use it in GitHub Desktop.

Select an option

Save resouer/2b45b9dbcaf29681ebfead77459c0cd9 to your computer and use it in GitHub Desktop.
Rook.io in Kubernetes
# On every node install ceph client
$ apt-get update && apt-get install ceph-common -y
$ kubectl apply -f https://raw.githubusercontent.com/rook/rook/release-0.5/cluster/examples/kubernetes/rook-operator.yaml
clusterrole "rook-operator" created
serviceaccount "rook-operator" created
clusterrolebinding "rook-operator" created
deployment "rook-operator" created
$ kubectl apply -f https://raw.githubusercontent.com/rook/rook/release-0.5/cluster/examples/kubernetes/rook-cluster.yaml
cluster "my-rook" created
$ kubectl apply -f https://raw.githubusercontent.com/rook/rook/release-0.5/cluster/examples/kubernetes/rook-storageclass.yaml
pool "replicapool" created
storageclass "rook-block" created
$ # Repeat this step for all namespaces you want to deploy PersistentVolumes with Rook in
$ kubectl get secret rook-rook-user -oyaml | sed "/resourceVer/d;/uid/d;/self/d;/creat/d;/namespace/d" | kubectl -n kube-system apply -f -
secret "rook-rook-user" created
$ # In order to make Rook the default Storage Provider by making the `rook-block` Storage Class the default, run this:
$ kubectl patch storageclass rook-block -p '{"metadata":{"annotations": {"storageclass.kubernetes.io/is-default-class": "true"}}}'
storageclass "rook-block" patched
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment