{"id":19551103,"url":"https://github.com/ksingh7/odf-nano","last_synced_at":"2025-04-26T20:31:07.477Z","repository":{"id":46205900,"uuid":"375464592","full_name":"ksingh7/odf-nano","owner":"ksingh7","description":"ODF-Nano lets you deploy OpenShift Data Foundation on your Laptop (CRC)","archived":false,"fork":false,"pushed_at":"2022-11-17T20:12:59.000Z","size":354,"stargazers_count":44,"open_issues_count":10,"forks_count":29,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-04T17:51:41.673Z","etag":null,"topics":["crc","odf"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ksingh7.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-06-09T19:13:47.000Z","updated_at":"2025-04-02T16:08:58.000Z","dependencies_parsed_at":"2023-01-23T11:00:25.291Z","dependency_job_id":null,"html_url":"https://github.com/ksingh7/odf-nano","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ksingh7%2Fodf-nano","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ksingh7%2Fodf-nano/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ksingh7%2Fodf-nano/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ksingh7%2Fodf-nano/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ksingh7","download_url":"https://codeload.github.com/ksingh7/odf-nano/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251051327,"owners_count":21528787,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["crc","odf"],"created_at":"2024-11-11T04:10:13.850Z","updated_at":"2025-04-26T20:31:07.098Z","avatar_url":"https://github.com/ksingh7.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"![](assets/odf-nano-logo-white.png)\n# Whats the need ?\n\n- Developers love OpenShift :heart:\n- Developers need local OpenShift environment (Solution : [CRC (CodeReady Containers)](https://developers.redhat.com/products/codeready-containers/overview) ) :computer:\n- Developers build Applications, that need Block/File/Object storage :hammer:\n- ODF provides Block/File/Object storage to OpenShift :ok_hand:\n- ODF Nano deploys ODF on CRC  :raised_hands:  :clap:\n\n\n# Introducing ODF-Nano\ntldr; Watch introduction \u0026 Demo Video [here](https://www.youtube.com/watch?v=mae0tiLkQag)\n\n`ODF-Nano` lets you deploy [OpenShift Data Foundation](https://www.redhat.com/en/technologies/cloud-computing/openshift-data-foundation) on your Laptop (CRC). \n- For dev/test experimentation developers ofter need persistent storage with CRC. \n- Currently CRC lacks clean \u0026 simple persistent storage solution,  `ODF-Nano` solves this problem for CRC. \n- Devs can now develop/test their apps locally using `CRC+ODF-Nano`. Once the app is ready, it could be deployed in production `OCP+ODF` without any change\n# Setup\n\n## Prerequisites\n### Host OS \n- RHEL 8, \n- Fedora 34 (tested) [ Feel free to test with other releases ]\n- Ubuntu 20.04 (tested) [ Feel free to test with other releases ]\n- MacOS ( Need more tests )\n\n### CRC / OC Binaries\n- Download CRC and OC binaries from [cloud.redhat.com]((https://cloud.redhat.com/openshift/create/local)\n- Create CRC directlry `mkdir ~/.crc`\n- Also get CRC pull secret from [cloud.redhat.com]((https://cloud.redhat.com/openshift/create/local) and save it as `~/.crc/pull-secret.txt`\n## Step -1 ::  Deploy CRC - Linux\n### Watch Demo Video [here](https://www.youtube.com/watch?v=mae0tiLkQag)\n\nNote : If you have already deployed CRC using [OpenSpot](https://github.com/ksingh7/openspot) project, you can skip step-1 and move directly to [step-2](https://github.com/ksingh7/odf-nano#step--2--deploy-odf-nano-on-crc)\n```\nmkdir ~/.crc\ncd ~/.crc\n# Get CRC pull secret from [cloud.redhat.com]((https://cloud.redhat.com/openshift/create/local) and save it as `~/.crc/pull-secret.txt`\ncrc config set consent-telemetry no\ncrc config set enable-cluster-monitoring true # Enable only if you have enough memory, needs ~4G extra\ncrc config set cpus 15 #Change as per your HW config\ncrc config set memory 60000 #Change as per your HW config\ncrc config set pull-secret-file ~/.crc/pull-secret.txt\ncrc config view\ncrc setup\nalias crcssh='ssh -i ~/.crc/machines/crc/id_ecdsa core@\"$(crc ip)\"'\ncrc start\ncrcssh uptime\ncrc console --credentials  \u003e crc-creds.txt\n```\n- Access https://console-openshift-console.apps-crc.testing from client machine\n\n## Step -2 :: Deploy ODF-Nano on CRC - Linux\n### Prerequisites\n- SSH into the host machine running CRC VM\n- Create a few raw devices that `ODF-Nano` will use\n```\n## Don't worry this is thin provisioned\nsudo -S qemu-img create -f raw ~/.crc/vdb 100G\nsudo -S qemu-img create -f raw ~/.crc/vdc 100G\n```\n\n- Attach these devices to CRC VM\n```\ncrc stop\nsudo virsh list --all\nsudo virsh dumpxml crc \u003e ~/crc.xml\nvim ~/crc.xml\n```\n- Add the following section to `crc.xml`\n- Make sure to set the correct disk path\n```\n    \u003cdisk type='file' device='disk'\u003e\n      \u003cdriver name='qemu' type='raw' cache='none'/\u003e\n      \u003csource file='~/.crc/vdb' index='1'/\u003e\n      \u003cbackingStore/\u003e\n      \u003ctarget dev='vdb' bus='virtio'/\u003e\n      \u003calias name='virtio-disk1'/\u003e\n      \u003caddress type='pci' domain='0x0000' bus='0x05' slot='0x00' function='0x0'/\u003e\n    \u003c/disk\u003e\n    \u003cdisk type='file' device='disk'\u003e\n      \u003cdriver name='qemu' type='raw' cache='none'/\u003e\n      \u003csource file='~/.crc/vdc' index='2'/\u003e\n      \u003cbackingStore/\u003e\n      \u003ctarget dev='vdc' bus='virtio'/\u003e\n      \u003calias name='virtio-disk2'/\u003e\n      \u003caddress type='pci' domain='0x0000' bus='0x06' slot='0x00' function='0x0'/\u003e\n    \u003c/disk\u003e\n```\n- Apply XML file and start CRC\n```\nsed -i \"s|~|$HOME|g\" ~/crc.xml\nsudo virsh define ~/crc.xml\ncrc start\n```\n- List devices to verify\n```\ncrcssh lsblk\n```\n\n## Step -1 ::  Deploy CRC - MACOS\n### Watch Demo Video [here](https://www.youtube.com/watch?v=mae0tiLkQag)\n\n```\nmkdir ~/.crc\ncd ~/.crc\n# Get CRC pull secret from [cloud.redhat.com]((https://cloud.redhat.com/openshift/create/local) and save it as `~/.crc/pull-secret.txt`\ncrc config set consent-telemetry no\ncrc config set enable-cluster-monitoring true # Enable only if you have enough memory, needs ~4G extra\ncrc config set cpus 9 #Change as per your HW config\ncrc config set memory 32768 #Change as per your HW config\ncrc config set disk-size 250 #Don't worry this is thin provisioned\ncrc config set pull-secret-file ~/.crc/pull-secret.txt\ncrc config view\ncrc setup\nalias crcssh='ssh -p 2222 -i ~/.crc/machines/crc/id_ecdsa core@\"$(crc ip)\"'\ncrc start\ncrcssh uptime\ncrc console --credentials  \u003e crc-creds.txt\n```\n- Access https://console-openshift-console.apps-crc.testing from client machine\n\n## Step -2 :: Deploy ODF-Nano on CRC - MACOS\n### Prerequisites\n- SSH into the host machine running CRC VM\n- Create a few loopback devices that `ODF-Nano` will use\n```\n## Don't worry this is thin provisioned\nsudo -i\nmkdir -p /var/lib/storage\ntruncate --size 220G /var/lib/storage/disk1\nlosetup -P /dev/loop1 /var/lib/storage/disk1\npvcreate /dev/loop1\nvgcreate odf /dev/loop1\nlvcreate -n disk1 -L 105G odf\nlvcreate -n disk2 -L 105G odf\n\nlsblk\n\ncat \u003c\u003c EOF \u003e /etc/systemd/system/lvm-odf-losetup.service\n[Unit]\nDescription=LVM ODF loopback device setup\nDefaultDependencies=no\nConflicts=umount.target\nRequires=lvm2-lvmetad.service systemd-udev-settle.service\nBefore=local-fs.target umount.target\nAfter=lvm2-lvmetad.service systemd-udev-settle.service\n[Service]\nType=oneshot\nExecStart=/sbin/losetup -P /dev/loop1 /var/lib/storage/disk1\nExecStop=/sbin/losetup -d /dev/loop1\nRemainAfterExit=yes\n[Install]\nWantedBy=local-fs-pre.target\nEOF\n\nsystemctl enable lvm-odf-losetup\n```\n\n### Deploy ODF-Nano on CRC\n\n-  Login to CRC using `kubeadmin`\n`oc login -u kubeadmin -p \u003cPWD\u003e https://api.crc.testing:6443`\n\n- Get `odf-nano`\n```\ngit clone https://github.com/ksingh7/odf-nano.git\ncd odf-nano\n```\n- Install `odf-nano` - LINUX\n```\nsh deploy_odf.sh\n```\n- Install `odf-nano` - MacOS\n```\nsh deploy_odf_macos.sh\n```\n\n\n- Sample output\n```\nSetting up environment for ODF - this will take a few minutes\nsubscription.operators.coreos.com/ocs-subscription created\nWaiting for operators to be ready\nNo resources found in openshift-storage namespace.\n.No resources found in openshift-storage namespace.\n...\n.No resources found in openshift-storage namespace.\n...............................\nOperators are ready now\nFinished up preparing the local storage\nODF is installing now, please be patient\nocsinitialization.ocs.openshift.io/ocsinit patched\npod/rook-ceph-tools-7d95854fb8-b78s2 condition met\nODF is installed now\n```\n- Verify ODF setup\n```\noc get sc\n```\n- You now have File/Block/Object Persistent Storage Classes from ODF. Deploy and Test your app locally, like you do in production (OCP \u0026 ODF)\n\n![ODF Storage Classes](assets/odf-sc.png)\n# Miscelleanous \n\n## ODF-Nano Resource Footprint \u0026 Components\n- Resource Footprint\n\n| CPU | Memory |\n| --------------- | --------------- |\n| 3 vCPU | 2.5G |\n\n- ODF Components\n\n| Component | Count |\n| ---------------  | --------------- |\n| MON | 1 |\n| MGR | 1 |\n| OSD | 2 |\n| MDS | 2 |\n| RGW | 1 |\n| Ceph-Tools | 1 |\n| ocs-metrics-exporter  | 1 |\n| ocs-operator | 1 |\n| noobaa-operator  | 1 |\n\n** Reducing MDS count to 1 is WIP **\n\n## Access CRC from a remote client\nBy default CRC cluster is reachable from localhost. Inorder to access a CRC cluster remotely, we need to add a proxy layer.\nThis setup is useful, when you want to deploy CRC on a remote machine (Home server or a Cloud bare metal), there has to be a way for  you to acces CRC cluster remotely. This procedure help you access your CRC remotely.\n\n-  Execute on the Host running CRC VM\n```\nSERVER_IP=0.0.0.0\nCRC_IP=$(crc ip)\nsudo cp /etc/haproxy/haproxy.cfg{,.bak}\nsudo semanage port -a -t http_port_t -p tcp 6443\nsudo tee /etc/haproxy/haproxy.cfg \u0026\u003e/dev/null \u003c\u003cEOF\n```\n\n```\nglobal\n    log /dev/log local0\n\ndefaults\n    balance roundrobin\n    log global\n    maxconn 100\n    mode tcp\n    timeout connect 5s\n    timeout client 500s\n    timeout server 500s\n\nlisten apps\n    bind 0.0.0.0:80\n    server crcvm $CRC_IP:80 check\n\nlisten apps_ssl\n    bind 0.0.0.0:443\n    server crcvm $CRC_IP:443 check\n\nlisten api\n    bind 0.0.0.0:6443\n    server crcvm $CRC_IP:6443 check\n```\n\n```\nsudo systemctl restart haproxy\nsudo systemctl status haproxy\n\nsudo netstat -plunt  | grep -i haproxy\n```\n- Example output from `netstat`\n```\n$ sudo netstat -plunt  | grep -i haproxy\ntcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      9291/haproxy\ntcp        0      0 0.0.0.0:443             0.0.0.0:*               LISTEN      9291/haproxy\ntcp        0      0 0.0.0.0:6443            0.0.0.0:*               LISTEN      9291/haproxy\n\n```\n\n## MACos Client Node \nhttps://www.stevenrombauts.be/2018/01/use-dnsmasq-instead-of-etc-hosts/\n\n```\nbrew install dnsmasq\nsudo brew services start dnsmasq\nmkdir -p /usr/local/etc/dnsmasq.d\ntouch /usr/local/etc/dnsmasq.d/crc.conf\nvim /usr/local/etc/dnsmasq.d/crc.conf\n```\n```\naddress=/.testing/192.168.1.6\n```\n- verify dns resolution\n```\nsudo brew services restart dnsmasq\ndig apps-crc.testing @127.0.0.1\ndig console-openshift-console.apps-crc.testing @127.0.0.1\n```\n```\nsudo mkdir /etc/resolver\nsudo vim /etc/resolver/testing\nnameserver 127.0.0.1\n\nscutil --dns\n\nping -c 1 foo.api.crc.testing\nping -c 1 foo.apps-crc.testing\nping -c 1 console-openshift-console.apps-crc.testing\n```\n\n## Uninstall ODF-Nano\n\n```\nbash uninstall_odf.sh\n```\n#  Troubleshooting\n\n- If running out of space, create a symlink for .crc\n```\nmkdir /mnt/hdd_space1/.crc\nln -s /mnt/hdd_space1/.crc ~/.crc\n```\n\n- To ssh into crc vm\n```\nssh -i ~/.crc/machines/crc/id_ecdsa core@\"$(crc ip)\"\n```\n- Deep clean previous instance of crc\n```\ncrc delete -f\ncrc cleanup\nrm -rf ~/.crc/vd* ~/.crc/crc* ~/.crc/bin ~/.crc/machines\nsudo virsh list --all\nsudo virsh destroy crc\nsudo virsh undefine crc\nvirsh vol-list --pool crc\n#virsh pool-destroy crc  # generally you can skip this\n# virsh vol-list --pool crc # generally you can skip this\n```\n- Increase root disk spaced of CRC VM\n\nBy defautl CRC  vm uses 30G of root disk, you definately need to increase that \n```\ncrcssh lsblk\n# Identify partition name of /sysroot\nvda    252:0    0   31G  0 disk\n|-vda1 252:1    0    1M  0 part\n|-vda2 252:2    0  127M  0 part\n|-vda3 252:3    0  384M  0 part /boot\n`-vda4 252:4    0 30.5G  0 part /sysroot\nvdb    252:16   0  100G  0 disk\nvdc    252:32   0  100G  0 disk\n\ncrc stop\n\nCRC_MACHINE_IMAGE=${HOME}/.crc/machines/crc/crc.qcow2\n\n# This resize is thin-provisioned\nsudo qemu-img resize ${CRC_MACHINE_IMAGE} +20G\nsudo cp ${CRC_MACHINE_IMAGE} ${CRC_MACHINE_IMAGE}.ORIGINAL\n\n#increase the /dev/sda4 (known as vda4 in the VM) disk partition size by an additional 20GB\nsudo virt-resize --expand /dev/sda4 ${CRC_MACHINE_IMAGE}.ORIGINAL ${CRC_MACHINE_IMAGE}\nsudo rm ${CRC_MACHINE_IMAGE}.ORIGINAL\ncrc start\n```\n# To-Do\n- Refer  issue#3\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fksingh7%2Fodf-nano","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fksingh7%2Fodf-nano","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fksingh7%2Fodf-nano/lists"}