Rook Storage for Kubernetes: Difference between revisions

From WilliamsNet Wiki
Jump to navigation Jump to search
(Created page with "== Background == == Installation Process == === Rook Operator === # set up all the namespace, roles, bindings, and support definition (ewilliam@aslan)/workspace/outside-rep...")
 
mNo edit summary
Line 5: Line 5:
=== Rook Operator ===
=== Rook Operator ===


# set up all the namespace, roles, bindings, and support definition
set up all the namespace, roles, bindings, and support definition
(ewilliam@aslan)/workspace/outside-repos/rook/cluster/examples/kubernetes/ceph>kubectl create -f common.yaml


# create the rook operator
kubectl create -f common.yaml
(ewilliam@aslan)/workspace/outside-repos/rook/cluster/examples/kubernetes/ceph>kubectl create -f operator.yaml


create the rook operator


kubectl create -f operator.yaml


=== Using Existing Ceph Cluster ===
=== Using Existing Ceph Cluster ===
# create the separate namespace where the ceph cluster definition will live
create the separate namespace where the ceph cluster definition will live
(ewilliam@aslan)/workspace/outside-repos/rook/cluster/examples/kubernetes/ceph>kubectl create -f common-external.yaml


# create secrets based on information extracted from ceph cluster
kubectl create -f common-external.yaml
(ewilliam@aslan)/workspace/outside-repos/rook/cluster/examples/kubernetes/ceph>bash ./import-external-cluster.sh


#
create secrets based on information extracted from ceph cluster
# note that the above script adds too many secrets -- the operator tries to create them and errors out since they can't be changed.
# We need to either edit the script to not create the excess secrets or delete the ones that aren't needed
# see which secrets are in the namespace for the external cluster
(ewilliam@aslan)/workspace/outside-repos/rook/cluster/examples/kubernetes/ceph>kubectl get secret -n rook-ceph-external


# these are the ones that need to be deleted (at least for now)
bash ./import-external-cluster.sh
(ewilliam@aslan)/workspace/outside-repos/rook/cluster/examples/kubernetes/ceph>kubectl -n rook-ceph-external delete secret \
 
note that the above script adds too many secrets -- the operator tries to create them and errors out since they can't be changed.
We need to either edit the script to not create the excess secrets or delete the ones that aren't needed
see which secrets are in the namespace for the external cluster
kubectl get secret -n rook-ceph-external
 
these are the ones that need to be deleted (at least for now)
kubectl -n rook-ceph-external delete secret \
     rook-csi-cephfs-node rook-csi-cephfs-provisioner rook-csi-rbd-node rook-csi-rbd-provisioner
     rook-csi-cephfs-node rook-csi-cephfs-provisioner rook-csi-rbd-node rook-csi-rbd-provisioner


# create the cluster definition
create the cluster definition
(ewilliam@aslan)/workspace/outside-repos/rook/cluster/examples/kubernetes/ceph>kubectl create -f cluster-external-management.yaml
 
kubectl create -f cluster-external-management.yaml
 
create the ceph pool and storage class definition for RBD images


# create the ceph pool and storage class definition for RBD images
kubectl create -f storageclass-block.yaml
(ewilliam@aslan)/workspace/outside-repos/rook/cluster/examples/kubernetes/ceph>kubectl create -f storageclass-block.yaml


=== Creating an internal Ceph Cluster ===
=== Creating an internal Ceph Cluster ===
Line 40: Line 43:
== Testing ==
== Testing ==


# deploy the test application
Deploy the test application; each deployment requests its own Persistent Volume.  The wordpress service is a LoadBalancer, so it will allocate an IP address that should give direct access to the wordpress instance.  The test manifests are in the kubernetes directory:
# each deployment requests its own Persistent Volume
 
# the wordpress service is a LoadBalancer, so it will allocate an IP address that should give direct access to the wordpress instance
cd rook/cluster/examples/kubernetes
(ewilliam@aslan)/workspace/outside-repos/rook/cluster/examples/kubernetes>kubectl create -f mysql.yaml
 
(ewilliam@aslan)/workspace/outside-repos/rook/cluster/examples/kubernetes>kubectl create -f wordpress.yaml
kubectl create -f mysql.yaml
kubectl create -f wordpress.yaml

Revision as of 00:41, 5 July 2020

Background

Installation Process

Rook Operator

set up all the namespace, roles, bindings, and support definition

kubectl create -f common.yaml

create the rook operator

kubectl create -f operator.yaml

Using Existing Ceph Cluster

create the separate namespace where the ceph cluster definition will live

kubectl create -f common-external.yaml

create secrets based on information extracted from ceph cluster

bash ./import-external-cluster.sh

note that the above script adds too many secrets -- the operator tries to create them and errors out since they can't be changed. We need to either edit the script to not create the excess secrets or delete the ones that aren't needed see which secrets are in the namespace for the external cluster

kubectl get secret -n rook-ceph-external

these are the ones that need to be deleted (at least for now)

kubectl -n rook-ceph-external delete secret \
   rook-csi-cephfs-node rook-csi-cephfs-provisioner rook-csi-rbd-node rook-csi-rbd-provisioner

create the cluster definition

kubectl create -f cluster-external-management.yaml

create the ceph pool and storage class definition for RBD images

kubectl create -f storageclass-block.yaml

Creating an internal Ceph Cluster

Testing

Deploy the test application; each deployment requests its own Persistent Volume. The wordpress service is a LoadBalancer, so it will allocate an IP address that should give direct access to the wordpress instance. The test manifests are in the kubernetes directory:

cd rook/cluster/examples/kubernetes
kubectl create -f mysql.yaml
kubectl create -f wordpress.yaml