How to create a container?

Hi all,

I just started learning about Harvester and was wondering if it is possible to create containers. Currently I only see the option to create Virtual Machine.

Thank you.

1 Like

I am also totally new to orchestration and would like an answer to this question, have you learned anything?

I am guessing has something to do with deployment via kubernetes? Not sure which of the menu options most closely aligns with interfacing with kubernetes…

Harvester provides the Hyper-Converged Infrastructure to run on bare metal., meaning it creates one logical ‘pool’ out of multiple hardware servers with shared storage and compute. On top of that you can deploy Kubernetes clusters with Rancher.
There are two similar ways to do that: already have a separate server running Rancher, spin up a VM with Docker installed, or a Kubernetes cluster inside Harvester. Deploy Rancher on top of that.

From the Rancher UI you can add the Harvester nodes (servers) and manage them from one UI. See: Rancher integration - Harvester - Open Source Hyperconverged Infrastructure (harvesterhci.io).
Within Rancher you create a new Kubernetes cluster and define the number of nodes (VM’s) to deploy - should be at least 3. This results in a Kubernetes cluster where you can then deploy Pods (a little ‘shell’ around a container), using the Rancher App store or your own Helm charts.

Of course, you can also just create a few VM’s in Rancher, install Docker in it and run your containers with docker run or docker-compose, but that would completely defeat the added value of Harvester and Rancher.

Actually, at Susecon’23 experimental support for bare metal containers was anounced and in 1.2 there was mention of this in the release notes. In 1.3 and in the documentation for 1.3 it seams to be missing in action.

It looks like one of the key distinguishing features of Harvester is not leveraged. Being based on Kubernetes was the main reason for me to look at Harvester in the first place. After all, there are many existing cluster solutions with distributed storage, like Proxmox, already on the market. Runnign VM’s is not a killer feature…

I used to run many docker containers on my Synology NAS.

Now, I got Harvester cluster and slowly moving all my containers to Harvester.

I tried Rancher, not sure why I would need it. Seems like in my case it’s not needed at all.

The way I run my apps “bare-metal” on Harvester Kubernetes now:

  • I take docker-compose file and “convert” it to Kubernetes YAML manifest
  • If I need storage (volume in Docker), I create PVC in Kubernetes. Alternatively you can just copy volume data to the Harvester node and use hostPath, but that’s not ideal, as the data will not be managed by LongHorn, will not be highly available and you’ll need to run the Kubernetes deployment on that specific node. So, use PVC. I only used hostPath for few apps, which uses few terrabytes of data, which doesn’t need to be mirrored.
  • If I need to migrate data from Docker volume to Kubernetes PVC - I run Ubuntu in Kubernetes attached to PVC and just copy data with rsync
  • I apply Kubernetes manifest and run it in the in Harvester!

Kubernetes YAML manifests are more verbose than docker-compose files, and don’t have 100% config options match.

I found that I can just paste docker-compose file to Google Gemini or ChatGPT and ask them to give me Kubernetes YAML. Not perfect, but mostly works.

It’s not that hard, really. If someone needs help, I can record video tutorial with steps on how to do that.

One gothca is that if you delete Kubernetes PVC - the data in PVC will be lost. Same way, as when you delete docker volume. I had snapshots for one PVC and though snapshots will stay if I delete PVC. Nope: when PVC get deleted - it’s deleted with all snapshots.

1 Like

So, it is as simple as that? Just kubectl maniferst.yaml to the VIP entrypoint? I’ll give it a try.
Thanks.

kubectl -f apply manifest.yaml