Difference between revisions of "Rook Kubernetes"

From UVOO Tech Wiki
Jump to navigation Jump to search
 
(10 intermediate revisions by the same user not shown)
Line 5: Line 5:
 
- https://jonathangazeley.com/2020/09/10/building-a-hyperconverged-kubernetes-cluster-with-microk8s-and-ceph/
 
- https://jonathangazeley.com/2020/09/10/building-a-hyperconverged-kubernetes-cluster-with-microk8s-and-ceph/
  
 +
 +
# Not creating for some reason with kubectl create yamls
 +
```
 +
for i in /var/lib/kubelet/pods /var/lib/kubelet/plugins_registry; do
 +
echo $i
 +
mkdir $i
 +
chmod 0777 $i
 +
done
 +
```
  
 
```
 
```
Line 11: Line 20:
 
kubectl create -f crds.yaml -f common.yaml -f operator.yaml
 
kubectl create -f crds.yaml -f common.yaml -f operator.yaml
 
kubectl create -f cluster.yaml
 
kubectl create -f cluster.yaml
 +
```
 +
 +
Check status
 +
```
 +
kubectl create -f toolbox.yaml
 +
kubectl -n rook-ceph exec -it $(kubectl -n rook-ceph get pod -l "app=rook-ceph-tools" -o jsonpath='{.items[0].metadata.name}') bash
 +
 +
kubectl create -f toolbox.yaml
 +
kubectl -n rook-ceph rollout status deploy/rook-ceph-tools
 +
kubectl -n rook-ceph exec -it deploy/rook-ceph-tools -- bash
 +
ceph status
 +
ceph osd status
 +
ceph df
 +
rados df
 +
 +
```
 +
 +
# Teardown
 +
- https://github.com/rook/rook/blob/master/Documentation/ceph-teardown.md
 +
```
 +
kubectl -n rook-ceph patch cephcluster rook-ceph --type merge -p '{"spec":{"cleanupPolicy":{"confirmation":"yes-really-destroy-data"}}}'
 +
kubectl -n rook-ceph delete cephcluster rook-ceph
 +
kubectl -n rook-ceph get cephcluster
 +
kubectl delete -f toolbox.yaml
 +
kubectl delete -f operator.yaml
 +
kubectl delete -f common.yaml
 +
kubectl delete -f crds.yaml
 +
rm -rf /var/lib/rook/*
 +
```
 +
 +
# Delete
 +
```
 +
kubectl api-resources --verbs=list --namespaced -o name \
 +
>  | xargs -n 1 kubectl get --show-kind --ignore-not-found -n rook-ceph
 +
 +
 +
kubectl -n rook-ceph patch cephclusters.ceph.rook.io rook-ceph --type merge -p '{"metadata":{"finalizers": [null]}}'
 +
kubectl delete cephcluster.ceph.rook.io/rook-ceph -n rook-ceph
 +
```
 +
 +
```
 +
kubectl -n rook-ceph describe pod csi-cephfsplugin-w7slh
 +
 +
for i in /var/lib/kubelet/pods /var/lib/kubelet/plugins_registry; do
 +
echo $i
 +
mkdir $i
 +
chmod 0777 $i
 +
done
 
```
 
```

Latest revision as of 23:05, 19 June 2021

Not creating for some reason with kubectl create yamls

for i in /var/lib/kubelet/pods /var/lib/kubelet/plugins_registry; do
echo $i
mkdir $i
chmod 0777 $i
done
git clone --single-branch --branch master https://github.com/rook/rook.git
cd rook/cluster/examples/kubernetes/ceph
kubectl create -f crds.yaml -f common.yaml -f operator.yaml
kubectl create -f cluster.yaml

Check status

kubectl create -f toolbox.yaml
kubectl -n rook-ceph exec -it $(kubectl -n rook-ceph get pod -l "app=rook-ceph-tools" -o jsonpath='{.items[0].metadata.name}') bash

kubectl create -f toolbox.yaml
kubectl -n rook-ceph rollout status deploy/rook-ceph-tools
kubectl -n rook-ceph exec -it deploy/rook-ceph-tools -- bash
ceph status
ceph osd status
ceph df
rados df

Teardown

kubectl -n rook-ceph patch cephcluster rook-ceph --type merge -p '{"spec":{"cleanupPolicy":{"confirmation":"yes-really-destroy-data"}}}'
kubectl -n rook-ceph delete cephcluster rook-ceph
kubectl -n rook-ceph get cephcluster
kubectl delete -f toolbox.yaml
kubectl delete -f operator.yaml
kubectl delete -f common.yaml
kubectl delete -f crds.yaml
rm -rf /var/lib/rook/*

Delete

kubectl api-resources --verbs=list --namespaced -o name \
>   | xargs -n 1 kubectl get --show-kind --ignore-not-found -n rook-ceph


kubectl -n rook-ceph patch cephclusters.ceph.rook.io rook-ceph --type merge -p '{"metadata":{"finalizers": [null]}}'
kubectl delete cephcluster.ceph.rook.io/rook-ceph -n rook-ceph
kubectl -n rook-ceph describe pod csi-cephfsplugin-w7slh

for i in /var/lib/kubelet/pods /var/lib/kubelet/plugins_registry; do
echo $i
mkdir $i
chmod 0777 $i
done