I’m thinking about starting a self hosting setup, and my first thought was to install k8s (k3s probably) and containerise everything.

But I see most people on here seem to recommend virtualizing everything with proxmox.

What are the benefits of using VMs/proxmox over containers/k8s?

Or really I’m more interested in the reverse, are there reasons not to just run everything with k8s as the base layer? Since it’s more relevant to my actual job, I’d lean towards ramping up on k8s unless there’s a compelling reason not to.

  • csm10495@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    10
    arrow-down
    1
    ·
    1 year ago

    Unless you have multiple systems, I don’t think k8s will yield much benefit over plain docker.

    • preciouspupp@sopuli.xyz
      link
      fedilink
      English
      arrow-up
      2
      ·
      1 year ago

      A multitude of things are far easier to do on Kubernetes. If you combine it with an immutable OS, then less effort too.

  • donalonzo@lemmy.world
    link
    fedilink
    English
    arrow-up
    5
    ·
    edit-2
    1 year ago

    VMs are often imperative and can be quite easy and familiar to setup for most people, but can be harder or more time-consuming to reproduce, depending on the type of update or error to be fixed. They have their own kernel and can have window managers and graphical interfaces, and can therefore also be a bit resource heavy.

    Containers are declarative and are quite easy to reproduce, but can be harder to setup, as you’ll have to work by trial-and-error from the CLI. They also run on your computers kernel and can be extremely slimmed down.

    They are both powerful, depends how you want to maintain and interface with them, how resource efficient you want them to be, and how much you’re willing to learn if necessary.

    • Spiritreader@kbin.social
      link
      fedilink
      arrow-up
      3
      ·
      1 year ago

      That sums it up really well.

      I generally tend to try to use containers for everything and only branch out to VMs if it doesn’t work or I need more separation.

      This is my general recommendation as containers are easier to set up and in my opinion individual software packages are easier to maintain with things like compose. I have limited time for my self hosted instance and that took away a lot of work, especially when updating.

    • Spiritreader@kbin.social
      link
      fedilink
      arrow-up
      2
      ·
      1 year ago

      That sums it up really well.

      I generally tend to try to use containers for everything and only branch out to VMs if it doesn’t work or I need more separation.

      This is my general recommendation as containers are easier to set up and in my opinion individual software packages are easier to maintain with things like compose. I have limited time for my self hosted instance and that took away a lot of work, especially when updating.

  • SilentMobius@lemmy.world
    link
    fedilink
    English
    arrow-up
    5
    ·
    1 year ago

    Personally I always use containers unless there is a good reason to use a VM, and those reasons do exist. Sometime you want a whole, fully functional OS complete with custom kernel, in that situation a VM is a good idea, sometimes a utility only comes packaged as a VM.

    But absent of a good reason, containers are just better in the majority of cases

  • klangcola@reddthat.com
    link
    fedilink
    English
    arrow-up
    3
    ·
    1 year ago

    Why not both?

    Like many others here, I went with Proxmox as the base host. But most of my services are Docker containers , running in a “dockerVM” on top of Proxmox.

    Having Proxmox as the base is just so flexible, which is very handy for a homelab.

    • For instance I set up a VM with Wireguard back when Wireguard had only just been merged in to the mainline kernel, without affecting the other
    • You can have separate VM for docker testing, and docker production
    • You can run multiple VMs for multiple Kubernetes hosts, to try it out and get your feet wet without affecting the “production” containers
    • If you get additional servers, you can just migrate those Kubernetes VMs
    • You can run Windows VM should you need, and BSD (and thus pfSense/opensense or TRUE AS)
    • You can run a full graphical environment if you want
    • Proxmox has easy setup for firewalls for each VM
    • I have a VM running a legacy bare metal system (from the same server now running proxmox) that I’ve been slowly de-commissioning piece by piece
    • soldersmoker@reddthat.com
      link
      fedilink
      English
      arrow-up
      1
      ·
      1 year ago

      What is your system backup solution like? Having it separated seems convenient for that since you can just back up the vm storage somewhere I’m guessing?

      • mr47@kbin.social
        link
        fedilink
        arrow-up
        2
        ·
        1 year ago

        Not OP, but similar setup (Proxmox with docker on a VM). The VM (plus a few LXCs) are backed up daily using the backup built into Proxmox, and those backups are mirrored to the cloud with rclone.

      • klangcola@reddthat.com
        link
        fedilink
        English
        arrow-up
        1
        ·
        1 year ago

        Proxmox Backup Server: Incremental de-duplicateed image backups of the whole VM, with possibility of individual file restore. It’s like magic

        For the legacy bare metal system I have rsnapshots of the data folder (set it up ages ago, and never changed it)

        An nginx LXC container has a single static backup of the container, with the nginx config file stored in a git repo

  • thegreenguy@kbin.social
    link
    fedilink
    arrow-up
    3
    ·
    1 year ago

    I personally really, really like (Docker) containers and I host most of my stuff with it, on a Raspberry Pi and on (free tier) Oracle Cloud VPS’s. I also plan to (re)install Proxmox on a spare old laptop and run some stuff in VMs on that (namely Home Assistant) and might try a NixOS server too.

    So really, use both. Use the right tool for the job. And you can also run containers in VMs and even use Ansible to configure everything with playbooks, allowing you to re-run said playbooks when things go wrong.

  • LetMeThinkAboutIt@programming.dev
    link
    fedilink
    English
    arrow-up
    2
    ·
    1 year ago

    Why not do both ? As I understand it, to do kubernetes clusters, you must have at least 3 hosts. They don’t need to be 3 different physical hosts: they could be VM (hosted on Proxmox).

    Proxmox also having a very strong implementation of ZFS, then it could be used as the storage « host », and it gives you also the option to do snapshots of the VM (and the storage pool), as well as replication/etc.

    • scottyjoe9@sh.itjust.works
      link
      fedilink
      English
      arrow-up
      3
      ·
      1 year ago

      A k8s cluster can run on a single host if that’s what you want. I’m not sure if it would be worth the virtualisation cost to run it on VMs in the middle as well. If you were only ever going to run on a single host I probably wouldn’t use k8s though, I would just run containers. 🤷‍♂️

  • zzz@kbin.social
    link
    fedilink
    arrow-up
    2
    ·
    1 year ago

    My backup solution is rsync and so I really like docker-compose since it usually means there is zero config for restoration of backups on a new computer besides installing docker-compose (which is usually one line on the terminal).

  • InverseParallax@lemmy.world
    link
    fedilink
    English
    arrow-up
    2
    ·
    1 year ago

    Por que los dos?

    Debian hypervisor with raidz2 hosting vms, the main ones being 1 main freebsd host with 20 jails containing 1-2 apps each, and 1 main debian vm hosting things that are too much of a pain in the ass to get running on freebsd, so it hosts 5 docker containers.

    Rocks my world.

  • adonis@kbin.social
    link
    fedilink
    arrow-up
    2
    ·
    1 year ago

    I use proxmox for the sole benefit of just spinning up a VM of choice without having to deal with usb-sticks, etc.

    From there I just run everything with Docker containers, via Portainer.

  • ChojinDSL@discuss.tchncs.de
    link
    fedilink
    English
    arrow-up
    2
    ·
    1 year ago

    Containers, unless you have a specific need for a VM.

    With a VM you have to reserve resources exclusively. If you give a VM 2gb of ram, then that’s 2gb of ram that you can’t use for other things, even if the guest OS is using less.

    With Containers, you only need as many resources as the process inside the container requires at the time.

  • Zardoz@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 year ago

    Not a proxmox pro by any means, but it can do both VMs and containers. I have a few VMs for various Linux distros to play around with. I also have one dedicated VM for all my security related tools.

    Stuff like PI hole, jellyfin, logstash, etc. dont really have any need for a full OS, so a container works perfectly. Plus having a full OS with several things running on it makes it more difficult if you just need to restart one service

    I started doing everything in VMs but over time realized some things were better to maintain as containers

  • GustavoM@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 year ago

    VMs if you have enough RAM and/or need to run something on a non-compatible system (like pfsense on ARM). Containers for everything else.