|
| 1 | +# Hacking |
| 2 | + |
| 3 | +### Ceph cluster |
| 4 | + |
| 5 | +As describe in the [Getting Started Guide](../README.md#getting-started), the |
| 6 | +`dev/create-ceph.sh` script can help us create a *toy* Ceph cluster we can use |
| 7 | +for development. |
| 8 | + |
| 9 | +### LVM backend |
| 10 | + |
| 11 | +Similar to the script that creates a *toy* Ceph backend there is also a script |
| 12 | +called `dev/create-lvm.sh` that create an LVM Cinder VG, within the CRC VM, |
| 13 | +that can be used by the Cinder LVM backend driver. |
| 14 | + |
| 15 | +### Helpers |
| 16 | + |
| 17 | +If we source `hack/dev/helpers.sh` we'll get a couple of helper functions: |
| 18 | + |
| 19 | +- `crc_login`: To login to the OpenShift cluster. |
| 20 | +- `crc_ssh`: To SSH to the OpenShift VM or to run SSH commands in it. |
| 21 | + |
| 22 | +### SSH OpenShift VM |
| 23 | + |
| 24 | +We can SSH into the OpenShift VM multiple ways: Using `oc debug`, using `ssh`, |
| 25 | +or using the `virsh console`. |
| 26 | + |
| 27 | +With `oc debug`: |
| 28 | + |
| 29 | +```sh |
| 30 | +$ oc get node |
| 31 | +NAME STATUS ROLES AGE VERSION |
| 32 | +crc-p9hmx-master-0 Ready master,worker 26d v1.24.0+4f0dd4d |
| 33 | + |
| 34 | +$ oc debug node/crc-p9hmx-master-0 |
| 35 | + |
| 36 | +sh-4.4# chroot /host |
| 37 | +``` |
| 38 | + |
| 39 | +To use `ssh` we can do: |
| 40 | + |
| 41 | +```sh |
| 42 | +$ ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i ~/.crc/machines/crc/id_ecdsa core@`crc ip` |
| 43 | + |
| 44 | +[core@crc-p9hmx-master-0 ~]$ |
| 45 | +``` |
| 46 | + |
| 47 | +Or we can use the helper function defined before to just do `crc_ssh`. |
| 48 | + |
| 49 | +### Containers in VM |
| 50 | + |
| 51 | +The OpenShift VM runs CoreOS and uses [Cri-O](https://cri-o.io/) as the |
| 52 | +container runtime, so once we are inside the container we need to use `crictl` |
| 53 | +to interact with the containers: |
| 54 | + |
| 55 | +```sh |
| 56 | +[core@crc-p9hmx-master-0 ~]$ sudo crictl ps |
| 57 | +``` |
| 58 | + |
| 59 | +And its configuration files are under `/etc/containers`. |
0 commit comments