[K8S] Steps to configure Rook Ceph BLOCK Storage on Vanilla Kubernetes cluster

Agenda:

  1. Attach new HDD
  2. Clone Rook Github Repo
  3. Install ROOK 
  4. Configure the Storage Class
  5. Configure Volume Snapshot class
  6. Validate Snapshot Creation

    

1) Attach new HDD - 10GB (or As per your need).

2) Clone Rook Github Repo
    A) mkdir /root/ROOK
    B) cd /root/ROOK
    # (SKIP the OLD) -> git clone --single-branch --branch release-1.5 https://github.com/rook/rook.git
    C) # USE LATEST ->
    $ git clone --single-branch --branch v1.12.4 https://github.com/rook/rook.git

 

3) Install ROOK 
    A) cd /root/ROOK/rook/deploy/examples
    B) # BEFORE RUNNING FOLLOWING COMMAND, Update operator.yaml: CSI_PROVISIONER_REPLICAS: "1" -> (Default is 2, change it to 1).
    C) kubectl create -f crds.yaml -f common.yaml -f operator.yaml 
    D) kubectl create -f cluster-test.yaml
    E) # Run following command to validate installation:
        kubectl -n rook-ceph get pod

 

4) Configure the Storage Class
    A) cd /root/ROOK/rook/deploy/examples/csi/rbd
    B) kubectl apply -f storageclass-test.yaml

    # Validate Storage class:
    -------------------------
    C) k get sc
        rook-ceph-block                    rook-ceph.rbd.csi.ceph.com   Delete          Immediate           true                   19s

 

5) Configure Volume Snapshot class -> (For creating snapshots)
    A) cd /root/ROOK/rook/deploy/examples/csi/rbd
    B) kubectl apply -f snapshotclass.yaml

    # Validate it using:
    --------------------
    kubectl get VolumeSnapshotClass
        NAME                            DRIVER                       DELETIONPOLICY   AGE
        csi-rbdplugin-snapclass         rook-ceph.rbd.csi.ceph.com   Delete           80s

 

6) Validate Snapshot Creation
    A) Create snap.yaml with following (Update NS, VSC, & PVC):
    ---
        apiVersion: snapshot.storage.k8s.io/v1
        kind: VolumeSnapshot
        metadata:
        name: rbd-pvc-snapshot
        namespace: shakti-rook-block-ns
        spec:
        volumeSnapshotClassName: csi-rbdplugin-snapclass
        source:
            persistentVolumeClaimName: pvc-new-test1

    B) kubectl apply -f snap.yaml
    C) kubectl get volumesnapshot -n <>

That's it.

 

REFERENCES:
---------------
    1) https://platform9.com/learn/v1.0/tutorials/rook-using-ceph-csi#step-1---install-lvm
    2) https://rook.io/docs/rook/v1.12/Getting-Started/quickstart/#tldr

Comments

Popular posts from this blog

KMP Algorithm: Pattern Searching in Text

Z-Function Algorithm: Substring Search

Back of the envelope estimations